|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (9 bit)
Join Date: Jul 2003
Location: Sheffield, UK
Posts: 292
|
perl - Stuck on something that seems simple.
OK, im following some random guide thing on the net, just out of curiosity more than anything. I wanted to see how perl worked, and how different it was to other stuff that ive dabbled with.
Anyway, on the first 'chapter' it wants me to.. # Write a program that prints its own source code using a back-quoted string. Now, it gives an example print "dir *.txt"; Which is supposed to list all the text files in the current directory i assume. When i tap this into bash, it works just fine. but it doesnt work in my perl script. It literally returns 'dir *.txt' but without the 's. Ive tryed a few different commands, and all i get is the same thing. it prints what im typing. Now , as the risk of sounding like an idiot, what is a back quote? All i have on my KB is " and '. Im stuck for ideas now so have come you you guys for some help, anyone know what im doing worng here? Its bugging me now lol. Nathan |
|
|
|
|
|
#2 |
|
Barefoot on the Moon!
Staff
Premium Member
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
|
The backquote is on the tilde key (the one below the escape key that you never use).
So, I'm guessing what you want looks like this: Code:
print `dir *.txt`;
__________________
There are two secrets to staying young, being happy, and achieving success. You have to laugh and find humor every day, and you have to have a dream.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|