On 9/17/07, Jeff Pang <[EMAIL PROTECTED]> wrote: > 2007/9/17, W. Sp. <[EMAIL PROTECTED]>: > > Also, while using LWP modules, what type of > > data is $content = get($url)? Is it an array? Is there a way to find out > > what kind of data a particular variable stores? > > It's a scalar. > you can use 'ref' to find out the variable type,like, > > $ perl -MLWP::Simple -e '$c=get "http://www.aol.com/";print ref \$c' > SCALAR snip
You should probable not call ref in this way. If $c had held a reference to an array it would have printed REF instead of ARRAY. Non reference values return undef when passed to ref. If you see SCALAR that means the value is a reference to a scalar. If you really want to see output you should say something like this: perl -MLWP::Simple -le '$c = get "http://3.am";print ref $c ? ref $c : "SCALAR VALUE"' -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/