Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Text Analysis: given(){when(){}} block throws a 'useless use of private variable...etc' error

by AnomalousMonk (Archbishop)
on Oct 18, 2010 at 17:25 UTC ( [id://865996]=note: print w/replies, xml ) Need Help??


in reply to Text Analysis: given(){when(){}} block throws a 'useless use of private variable...etc' error

>perl -wMstrict -lE "my ($foo, $bar) = qw(FOO BAR); given ($foo) { when ($foo eq 'FOO') { print 'got a FOO'; } } " got a FOO >perl -wMstrict -lE "my ($foo, $bar) = qw(FOO BAR); given ($foo, $bar) { when ($foo eq 'FOO') { print 'got a FOO'; } } " Useless use of private variable in void context at... got a FOO

See Switch statements in perlsyn.

  • Comment on Re: Text Analysis: given(){when(){}} block throws a 'useless use of private variable...etc' error
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2025-03-24 18:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (65 votes). Check out past polls.

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.