Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: Renaming Files

by Tomte (Priest)
on Feb 20, 2003 at 06:21 UTC ( [id://236992]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Renaming Files
in thread Renaming Files

my perl seems to be...
#!/usr/bin/perl -w print 'test\n'; print "test\n"; __END__ test\ntest

Update:

perldoc perldata

String literals are usually delimited by either single or double quotes. They work much like quotes in the standard Unix shells: double-quoted string literals are subject to backslash and variable substitution; single-quoted strings are not (except for "\'" and "\\").

regards,
tomte


Replies are listed 'Best First'.
Re: Re: Re: Re: Renaming Files
by thor (Priest) on Feb 20, 2003 at 12:36 UTC
    and mine doesn't
    #!perl -w print '\' __END__ Can't find string terminator "'" anywhere before EOF at C:\test.pl lin +e3
    ...because it thinks I'm trying to escape a single quote. So, single quotes obviously do some sort of backslash interpolation. Your original point was that he didn't have to escape the \ in "c:\path\to\something". I think of it this way: nothing interpolates within single quotes, including escape sequences. If you do something like $string = 'some string\t\n', the result will interpolate to the right thing in double quotes. Now, that having been said, one can embolden perldata another way:
    String literals are usually delimited by either single or double quotes. They work much like quotes in the standard Unix shells: double-quoted string literals are subject to backslash and variable substitution; single-quoted strings are not (except for "\'" and "\\")
    I concede that I was mistaken. My apologies.

    thor

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://236992]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-19 10:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found