[25831] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8068 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 11 00:05:27 2005

Date: Tue, 10 May 2005 21:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 10 May 2005     Volume: 10 Number: 8068

Today's topics:
    Re: Basic question - having one program calling another (Chris Page)
    Re: Basic question - having one program calling another <1usa@llenroc.ude.invalid>
    Re: Inserting & Updating from txtx to a database! <tadmc@augustmail.com>
    Re: Media Lending Library - web based application <mdetomaso@bak.rr.com>
    Re: Media Lending Library - web based application <1usa@llenroc.ude.invalid>
    Re: Simple error using GD::Graph on Windows <pump_yo_brakes@hotgetridofthisbitmail.com>
    Re: Simple error using GD::Graph on Windows <sisyphus1@nomail.afraid.org>
    Re: Simple error using GD::Graph on Windows <pump_yo_brakes@hotgetridofthisbitmail.com>
    Re: Simple error using GD::Graph on Windows <sisyphus1@nomail.afraid.org>
    Re: Simple error using GD::Graph on Windows <pump_yo_brakes@hotgetridofthisbitmail.com>
        Storable - Win32 to Linux <goodcall1@hotmail.dot.com>
    Re: Storable - Win32 to Linux <1usa@llenroc.ude.invalid>
    Re: Storable - Win32 to Linux <goodcall1@hotmail.dot.com>
    Re: Storable - Win32 to Linux <1usa@llenroc.ude.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 10 May 2005 19:02:46 -0400
From: page@studentnojunk.physics.upenn.edu (Chris Page)
Subject: Re: Basic question - having one program calling another
Message-Id: <page-1005051902460001@192.168.12.24>

In article <Xns9652AC43986DCasu1cornelledu@132.236.56.8>, "A. Sinan Unur"
<1usa@llenroc.ude.invalid> wrote:
> perldoc -f system
> 
> is a good place to start to find out how to call an external program.
> 
> In a Perl program, you can access command line arguments via @ARGV. It is 
> documented in perldoc perlvar.
> 

Thank you. @ARGV was what I was missing -- I was looking for its
equivalent in the wrong place (perldoc perlrun). I did spend a week
trying to figure out this question from perlboot, perltoot, 
perlsub, perlrun, perlmod, and a number of the individual 
functions (including "system"). But somehow I missed @ARGV,
probably being new to perl syntax/concepts.

> 
> Hmmmm ... I have lost count of how many times I asked the question "What 
> have you done so far?" just in the last two days.
> 
> The weather here is great, my office hours are over, I am feeling good, 
> etc etc, so I am just going to ask you to please read the posting 
> guidelines for the group, and take a look at the example below.
> 
> Remember, to research and try first, and then ask everyone else.

My apologies. I've now read the posting guidelines, should I get
lost enough to look for further help.

-Chris Page
page@studentnojunk.physics.upenn.edu


------------------------------

Date: Tue, 10 May 2005 22:45:16 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Basic question - having one program calling another
Message-Id: <Xns9652BEA6B136Basu1cornelledu@127.0.0.1>

page@studentnojunk.physics.upenn.edu (Chris Page) wrote in
news:page-1005051902460001@192.168.12.24: 

> In article <Xns9652AC43986DCasu1cornelledu@132.236.56.8>, "A. Sinan
> Unur" <1usa@llenroc.ude.invalid> wrote:
>> perldoc -f system
>> 
>> is a good place to start to find out how to call an external program.
>> 
>> In a Perl program, you can access command line arguments via @ARGV.
>> It is documented in perldoc perlvar.
>> 
> 
> Thank you. @ARGV was what I was missing -- 

I am glad it worked out. However, I do not know your reasons for wanting 
to do this. If it is a learning exercise, that's fine. Otherwise, please 
take a look at Gunnar's response as well.

> My apologies. I've now read the posting guidelines, should I get
> lost enough to look for further help.

Thank you very much. 

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


------------------------------

Date: Tue, 10 May 2005 18:33:44 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Inserting & Updating from txtx to a database!
Message-Id: <slrnd82h6o.cna.tadmc@magna.augustmail.com>

Nikos <hackeras@gmail.com> wrote:

> I just need 


No you don't. You already have one.

So what is it that you are here for again?


> some way to update the mysql table if a gamename exists in 
> the mayswl table games or insert a new one if it does not.


What is "mayswl" ?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Wed, 11 May 2005 00:58:23 GMT
From: "Michael De Tomaso" <mdetomaso@bak.rr.com>
Subject: Re: Media Lending Library - web based application
Message-Id: <PMcge.41$887.3@tornado.socal.rr.com>

Better ???

>
> People who persist in posting a ten-line .sig after being
> asked to repair it risk getting killfiled.
>


-- 
Michael Anthony De Tomaso
eye vant 2 B a clone 




------------------------------

Date: Wed, 11 May 2005 01:09:44 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Media Lending Library - web based application
Message-Id: <Xns9652D7238A358asu1cornelledu@127.0.0.1>

"Michael De Tomaso" <mdetomaso@bak.rr.com> wrote in news:PMcge.41$887.3
@tornado.socal.rr.com:

> Better ???
 ...
> -- 
> Michael Anthony De Tomaso
> eye vant 2 B a clone 

Absolutely.

Thank you.

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


------------------------------

Date: Wed, 11 May 2005 09:32:31 +0930
From: Mr Hyde <pump_yo_brakes@hotgetridofthisbitmail.com>
Subject: Re: Simple error using GD::Graph on Windows
Message-Id: <3qi281t96087cili3jfcn75cc3lsi1u5sl@4ax.com>

On Tue, 10 May 2005 03:32:41 GMT, "A. Sinan Unur"
<1usa@llenroc.ude.invalid> wrote:

>Mr Hyde <pump_yo_brakes@hotgetridofthisbitmail.com> wrote in 
>news:fa6081dbib317m7o5n07e8t0dtgju44r3i@4ax.com:
>
>> Hi guys,
>> 
>> My apologies if this is a simple issue: I've been hacking away at it
>> for too long and have had no luck finding other people with the same
>> issue.
>> 
>> I have a very simple script named draw.pl: 
>> 
>> ---begin
>> 
>> use GD::Graph::bars;
>> 
>> my $graph = GD::Graph::bars->new(800, 600);
>> 
>> ---end
>> 
>> cut down to isolate the issue. When I run the command
>> 
>> perl draw.pl
>> 
>> it comes up with the error
>> 
>> Can't locate object method "new" via package "GD::Image" at
>> D:/Perl/site/lib/GD/Graph.pm line 286.
>
>You need
>
>use GD::Graph;
>
>before
>
>use GD::Graph::bars;
>
>Sinan

Thanks Sinan, though unfortunately that doesn't work. I've now got

use GD::Graph;
use GD::Graph::bars;

my $graph = GD::Graph::bars->new(800, 600);

however I still get the same error.


------------------------------

Date: Wed, 11 May 2005 11:39:34 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Simple error using GD::Graph on Windows
Message-Id: <4281625f$0$10303$afc38c87@news.optusnet.com.au>


"Mr Hyde" <pump_yo_brakes@hotgetridofthisbitmail.com> wrote in message
> >>
> >> Can't locate object method "new" via package "GD::Image" at
> >> D:/Perl/site/lib/GD/Graph.pm line 286.
> >
> >You need
> >
> >use GD::Graph;
> >
> >before
> >
> >use GD::Graph::bars;
> >
> >Sinan
>
> Thanks Sinan, though unfortunately that doesn't work. I've now got
>
> use GD::Graph;
> use GD::Graph::bars;
>
> my $graph = GD::Graph::bars->new(800, 600);
>
> however I still get the same error.

What does line 286 of GD.pm say ? (Provide a few lines either side, for
context.)

Cheers,
Rob




------------------------------

Date: Wed, 11 May 2005 11:31:18 +0930
From: Mr Hyde <pump_yo_brakes@hotgetridofthisbitmail.com>
Subject: Re: Simple error using GD::Graph on Windows
Message-Id: <mip281h8a348spsasd9j5ms3liqqkokris@4ax.com>

On Wed, 11 May 2005 11:39:34 +1000, "Sisyphus"
<sisyphus1@nomail.afraid.org> wrote:
>> >> Can't locate object method "new" via package "GD::Image" at
>> >> D:/Perl/site/lib/GD/Graph.pm line 286.
>> >
>> >You need
>> >
>> >use GD::Graph;
>> >
>> >before
>> >
>> >use GD::Graph::bars;
>> >
>> >Sinan
>>
>> Thanks Sinan, though unfortunately that doesn't work. I've now got
>>
>> use GD::Graph;
>> use GD::Graph::bars;
>>
>> my $graph = GD::Graph::bars->new(800, 600);
>>
>> however I still get the same error.
>
>What does line 286 of GD.pm say ? (Provide a few lines either side, for
>context.)
>
>Cheers,
>Rob
>

I'm assuming you mean GD\Graph.pm. Line 286 (and the surrounding
segment) is 


sub open_graph
{
    my $self = shift;
    return $self->{graph} if exists $self->{graph};

#This next line is 286
    $self->{graph} = GD::Image->new($self->{width}, $self->{height}); 
}

Now my knowledge of perl is really quite limited, but should there be
a file Image.pm in my GD folder? There isn't, so is it spitting the
dummy because of that?

Hyde


------------------------------

Date: Wed, 11 May 2005 12:38:18 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Simple error using GD::Graph on Windows
Message-Id: <42817022$0$10306$afc38c87@news.optusnet.com.au>


"Mr Hyde" <pump_yo_brakes@hotgetridofthisbitmail.com> wrote in message

>
> I'm assuming you mean GD\Graph.pm. Line 286 (and the surrounding
> segment) is
>
>
> sub open_graph
> {
>     my $self = shift;
>     return $self->{graph} if exists $self->{graph};
>
> #This next line is 286
>     $self->{graph} = GD::Image->new($self->{width}, $self->{height});
> }
>

That should be ok, I think. GD.pm knows all about GD::Image objects, and
GD::Graph loads GD.pm .... so I'm not sure what's going on.

Does the following run without error for you:

use GD;
$im = GD::Image->new(800, 800);
print "OK\n";
__END__

If so, then maybe you just need to "use GD;" at the start of your script
 ..... though why that should be necessary eludes me.

Cheers,
Rob




------------------------------

Date: Wed, 11 May 2005 13:23:39 +0930
From: Mr Hyde <pump_yo_brakes@hotgetridofthisbitmail.com>
Subject: Re: Simple error using GD::Graph on Windows
Message-Id: <od0381prr6minhdoid2nvjqoaad17o9fvb@4ax.com>

On Wed, 11 May 2005 12:38:18 +1000, "Sisyphus"
<sisyphus1@nomail.afraid.org> wrote:

>Does the following run without error for you:
>
>use GD;
>$im = GD::Image->new(800, 800);
>print "OK\n";
>__END__
>
>If so, then maybe you just need to "use GD;" at the start of your script
>..... though why that should be necessary eludes me.
>
>Cheers,
>Rob
>

Problem solved! It appears the problem was that it couldn't find the
GD library, not sure why. I added 

use lib "/Perl/site/lib";

above the "use GD;" line and it worked fine. Now I was under the
impression it would have added its own library to the path when it
installed, but I guess not.

Thanks for all your help.


------------------------------

Date: Tue, 10 May 2005 23:13:41 GMT
From: "Jack D" <goodcall1@hotmail.dot.com>
Subject: Storable - Win32 to Linux
Message-Id: <Febge.35964$0X6.17115@edtnps90>

If I save a hash to disc on Win32 using Storable, and then copy the
resulting file to a Linux system - will the file be readable using the
retrieve funtion on the Linux system? If yes - will the version of Perl
matter?

Jack




------------------------------

Date: Tue, 10 May 2005 23:40:15 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Storable - Win32 to Linux
Message-Id: <Xns9652C7F82E16Easu1cornelledu@127.0.0.1>

"Jack D" <goodcall1@hotmail.dot.com> wrote in news:Febge.35964$0X6.17115
@edtnps90:

> If I save a hash to disc on Win32 using Storable, and then copy the
> resulting file to a Linux system - will the file be readable using the
> retrieve funtion on the Linux system? If yes - will the version of Perl
> matter?

What did you find out when you consulted the documentation?

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


------------------------------

Date: Tue, 10 May 2005 23:50:59 GMT
From: "Jack D" <goodcall1@hotmail.dot.com>
Subject: Re: Storable - Win32 to Linux
Message-Id: <DNbge.59053$HR1.5314@clgrps12>


"A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
news:Xns9652C7F82E16Easu1cornelledu@127.0.0.1...
> "Jack D" <goodcall1@hotmail.dot.com> wrote in news:Febge.35964$0X6.17115
> @edtnps90:
>
> > If I save a hash to disc on Win32 using Storable, and then copy the
> > resulting file to a Linux system - will the file be readable using the
> > retrieve funtion on the Linux system? If yes - will the version of Perl
> > matter?
>
> What did you find out when you consulted the documentation?

I see no reference to how different platforms handle these files. All I see
is storing over a socket - which is not something I wish to do. If you can
find a section in the documentation which discusses this - I would be more
than happy to read it. If you intend to refer me to something called
"network order" then it would be nice if this were defined first.

Jack




------------------------------

Date: Wed, 11 May 2005 00:06:41 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Storable - Win32 to Linux
Message-Id: <Xns9652CC72FB93Aasu1cornelledu@127.0.0.1>

"Jack D" <goodcall1@hotmail.dot.com> wrote in
news:DNbge.59053$HR1.5314@clgrps12: 

> 
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote in message
> news:Xns9652C7F82E16Easu1cornelledu@127.0.0.1...
>> "Jack D" <goodcall1@hotmail.dot.com> wrote in
>> news:Febge.35964$0X6.17115 @edtnps90:
>>
>> > If I save a hash to disc on Win32 using Storable, and then copy the
>> > resulting file to a Linux system - will the file be readable using
>> > the retrieve funtion on the Linux system? If yes - will the version
>> > of Perl matter?
>>
>> What did you find out when you consulted the documentation?
> 
> I see no reference to how different platforms handle these files. All
> I see is storing over a socket - 

Specifically,

    You can also store data in network order to allow easy sharing
    across multiple platforms, or when storing on a socket known to
    be remotely connected. The routines to call have an initial n 
    prefix for network, as in nstore and nstore_fd.

The use of 'or' means using nstore is not limited to only transmission 
over sockets, but desirable whenever cross platform compatibility of 
files is needed.

> I would be more than happy to read it. If you intend to refer me to
> something called "network order" then it would be nice if this were
> defined first. 

http://www.google.com/search?q=define%3A+network+order

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8068
***************************************


home help back first fref pref prev next nref lref last post