Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: Context tutorial

by jdporter (Canon)
on Jun 16, 2011 at 12:28 UTC ( #909938=note: print w/replies, xml ) Need Help??


in reply to Re: Context tutorial
in thread Context tutorial

That's because you don't know what you're talking about.

Replies are listed 'Best First'.
Re^3: Context tutorial
by toro (Beadle) on Jun 16, 2011 at 23:49 UTC
    You're right. Don't know what I did before. deleting...

    $ perl -e "$now = localtime(); print $now;" syntax error at -e line 1, near "=" Execution of -e aborted due to compilation errors.

    As explained to me by ikegami and runrig in the chatterbox: perl -e "$now = localtime(); print $now;" and perl -e ' = localtime(); print ;' are equivalent in bash (Ubuntu's default) unless $now is an Environmental variable within the Bash shell.

    In other words if one is doing some Bash scripting and has defined $1 as a variable within that shell-script ... then the way to access that same system (environmental) $1 is to use perl -e " ... $1 ... ".

    Cheers.

      bash does support double quotes, but «\», «"» and «$» (and maybe more) are special in double quotes.

      $ perl -E'my $x = qq{abc\\def}; say $x' abc\def $ perl -E"my \$x = qq{abc\\\\def}; say \$x" abc\def
      On guard perl -le print~~localtime
        ~~? Can you provide a reference please?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://909938]
help
Chatterbox?
[Lady_Aleena]: I'll just have to search for the files using the subs and open them up.
[Discipulus]: nice Perl dreams, folks.. shower->Dumas->bed
[erix]: pere ou fils?
[Lady_Aleena]: Discipulus, good night.
[Discipulus]: pere, le vicomte de bragelonne.. wonderfull

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-05-23 19:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?