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

Re: Result of failed regexp match not pushed onto array

by AnomalousMonk (Archbishop)
on Feb 16, 2019 at 19:50 UTC ( [id://1230002]=note: print w/replies, xml ) Need Help??


in reply to Result of failed regexp match not pushed onto array

It's often useful to see what's actually in a structure like an array or hash:

c:\@Work\Perl\monks>perl -wMstrict -le "use Data::Dump qw(pp); ;; my @foo; my $bar; ;; $bar = 42; push @foo, $bar; print 'A: ', pp(@foo); $bar = 'abc' =~ /abc/; push @foo, $bar; print 'B: ', pp(@foo); $bar = 'abc' =~ /abcd/; push @foo, $bar; print 'C: ', pp(@foo); $bar = ''; push @foo, $bar; print 'D: ', pp(@foo); $bar = 0; push @foo, $bar; print 'E: ', pp(@foo); $bar = undef; push @foo, $bar; print 'F: ', pp(@foo); push @foo, (); print 'G: ', pp(@foo); " A: 42 B: (42, 1) C: (42, 1, "") D: (42, 1, "", "") E: (42, 1, "", "", 0) F: (42, 1, "", "", 0, undef) G: (42, 1, "", "", 0, undef)
See Data::Dump, which is not core, or Data::Dumper, which is.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1230002]
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: (6)
As of 2024-04-26 09:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found