Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Getting attachments from request in perl

by johngg (Canon)
on Jan 18, 2018 at 18:15 UTC ( #1207480=note: print w/replies, xml ) Need Help??


in reply to Re^2: Getting attachments from request in perl
in thread Getting attachments from request in perl

I don't exactly know how should I use Data::Dumper

Best to have a quick look at the Data::Dumper documentation. The Dumper() function is exported by default and gives a pretty crude picture of the data. Give it an array and it will treat each element as a separate variable but give it a reference to the array and you see an anonymous array. Dump() and its faster but not always available sibling Dumpxs() are fiddlier but more useful as they can give a more accurate picture.

Here's a brief example.

johngg@shiraz ~ $ perl -Mstrict -Mwarnings -MData::Dumper -E ' my @atts = qw{ att1 att2 att3 }; say Dumper( @atts ); say Dumper( \ @atts ); say Data::Dumper->Dump( [ \ @atts ], [ qw{ *atts } ] ); say Data::Dumper->Dumpxs( [ \ @atts ], [ qw{ *atts } ] );' $VAR1 = 'att1'; $VAR2 = 'att2'; $VAR3 = 'att3'; $VAR1 = [ 'att1', 'att2', 'att3' ]; @atts = ( 'att1', 'att2', 'att3' ); @atts = ( 'att1', 'att2', 'att3' );

I hope this is helpful.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^4: Getting attachments from request in perl
by Stetec (Novice) on Jan 18, 2018 at 23:23 UTC
    Thank you for explanation. When I use Dump function on attachments array I get string "@attachments = ();". I really don't know what kind of anomaly is this. I just found out that I can get nothing from request, not only file.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2018-11-16 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (193 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!