Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: how to make this perl code run

by LanX (Chancellor)
on May 16, 2013 at 16:46 UTC ( #1033867=note: print w/replies, xml ) Need Help??


in reply to how to make this perl code run

> (without mucking with strict.pm or adding command line options or using non-standard perl versons).

and actually really executing the code! =)

#!/usr/bin/perl -w use strict; my $str1 = hi; my $str2 = hello; my $str3 = hola; print uc("$str1, $str2, $str3 you ... ! ;-)"); BEGIN { open my $file,"<",$0; my $code=do{local $/=undef;<$file>}; $code =~ s/use strict;//; $code =~ s/^BEGIN.*\E//sm; no strict "subs"; no warnings; eval "$code" or die $@; exit; } #EOF

prints HI, HELLO, HOLA YOU ... ! ;-)

Cheers Rolf

( addicted to the Perl Programming Language)

update

changed output to less sarcasm

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1033867]
help
Chatterbox?
[Corion]: Lady_Aleena: Hopefully someone would step up to the plate!
[Lady_Aleena]: Corion, I could give the password to the gods to hold onto just in case.
[Discipulus]: Justin Case god can always get your pwd LA ;=) they all see, they all ear, they all know ;=)

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2017-04-26 08:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (471 votes). Check out past polls.