Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How do I access the contents of a glob???

Reply
Thread Tools

How do I access the contents of a glob???

 
 
bbrelin@gmail.com
Guest
Posts: n/a
 
      07-22-2005
Hello,

If I have a function like

foo ($myvar) {
}

and...

ref($myvar) = "GLOB"

How do I view the contents of $myvar?

I've tried doing a print *$myvar I get something like:

*GLOB(0xb464bc

I want to print the actual data contained in the glob. How do I do
that?

Thanks,

Braun Brelin

 
Reply With Quote
 
 
 
 
xhoster@gmail.com
Guest
Posts: n/a
 
      07-22-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> Hello,
>
> If I have a function like
>
> foo ($myvar) {
> }
>
> and...
>
> ref($myvar) = "GLOB"
>
> How do I view the contents of $myvar?
>
> I've tried doing a print *$myvar I get something like:
>
> *GLOB(0xb464bc
>
> I want to print the actual data contained in the glob. How do I do
> that?


Data:umper.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      07-23-2005
(E-Mail Removed) <(E-Mail Removed)> wrote:


> If I have a function like
>
> foo ($myvar) {
> }



Then you do not have a function written in the Perl programming language.

Did you mean a function definition:

sub foo { }
or
sub foo ($) { } # with prototype

Or did you mean a function call:

foo ($myvar);

??


> ref($myvar) = "GLOB"



ref() is not an lvalue subroutine, so that is not in Perl either.

Did you mean:

ref($myvar) eq "GLOB"

??


> How do I view the contents of $myvar?



Post real Perl if you'd like real help.


> I've tried doing a print *$myvar I get something like:
>
> *GLOB(0xb464bc
>
> I want to print the actual data contained in the glob.



A glob contains a scalar and an array and a hash and ...

Do you want to print the scalar data, or the array data,
or the hash data...?


> How do I do
> that?



We do not know what code you are using.

We do not even know what, exactly, it is that you want to accomplish.

We are going to get nowhere without some useful information.

Post a short and complete program *that we can run* that illustrates
your problem, and we can probably help to solve your problem.

Have you seen the Posting Guidelines that are posted here frequently?


--
Tad McClellan SGML consulting
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Adding contents on yaml file without overwriting actual contents Kamarulnizam Rahim Ruby 4 01-28-2011 09:10 AM
if innerHTML used twice then it replaces the contents i want it to display all the contents virendra.amritkar@gmail.com Javascript 0 06-29-2007 08:13 AM
can .net access HTML tag contents and modify them? darrel ASP .Net 2 09-08-2004 08:47 PM
Can I restrict both attribute contents and element contents in schema Don Adams XML 1 03-05-2004 12:48 PM



Advertisments