[18379] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 547 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 22 06:05:40 2001

Date: Thu, 22 Mar 2001 03:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <985259110-v10-i547@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 22 Mar 2001     Volume: 10 Number: 547

Today's topics:
    Re: Beginner's question <pne-news-20010322@newton.digitalspace.net>
    Re: Can't combine > and $ <bart.lateur@skynet.be>
    Re: Can't combine > and $ <krahnj@acm.org>
    Re: Can't combine > and $ <jrk@sys.uea.ac.uk>
    Re: Can't combine > and $ <bart.lateur@skynet.be>
    Re: Capturing both STDOUT and STDERR from `ls` ? nobull@mail.com
    Re: CGI redirect implementation (Philip Lees)
    Re: CGI redirect implementation <bart.lateur@skynet.be>
    Re: CGI redirect implementation <me@dev.null>
    Re: checkbox problem <m.grimshaw@salford.ac.uk>
    Re: DBI and Activestate's perlapp <mkuin@globalrangers.com>
    Re: Help determining ShockwaveFlash h & w? <gtoomey@usa.net>
    Re: Help determining ShockwaveFlash h & w? <bart.lateur@skynet.be>
    Re: how do you pass arguements into the "do" command? <christoph.neubauer@siemens.at>
    Re: how do you pass arguements into the "do" command? <christoph.neubauer@siemens.at>
    Re: how do you pass arguements into the "do" command? nobull@mail.com
    Re: How do/Can I ... A question on shared libraries. nobull@mail.com
    Re: How to find the existence of an array variable? nobull@mail.com
    Re: Newbie : Can I open a file from another web server  <gtoomey@usa.net>
    Re: passing two arrays two a sub <bart.lateur@skynet.be>
    Re: Perl 5.6 - Spinning cursor routine? (Damian James)
    Re: Perl FAQ? <pne-news-20010322@newton.digitalspace.net>
    Re: Perl FAQ? (Eric Bohlman)
    Re: persistent cookie working with Netscape4.7x, not IE <m.grimshaw@salford.ac.uk>
        Resize and save an image <franck01@noos.fr>
    Re: Why do "Learning Perl" Books Do This? A Subroutine  <pne-news-20010322@newton.digitalspace.net>
    Re: Words in a String variable (Rafael Garcia-Suarez)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 22 Mar 2001 11:23:19 +0100
From: Philip Newton <pne-news-20010322@newton.digitalspace.net>
Subject: Re: Beginner's question
Message-Id: <nikjbto5fenmjmu3j63i1rvle8rqkc133s@4ax.com>

On Wed, 21 Mar 2001 11:31:58 -0800, "Jürgen Exner" <juex@deja.com>
wrote:

> "Jeff Myers" <myers@infinet.com> wrote in message
> news:3ab8f3e0$0$53493$f5f63664@news.tdin.com...
> > print $words($temp);
> and here you are accessing ..., well what is this? Applying the function
> reference stored in scalar $words to $temp? Something obscure like that.

Hint: write it as

    print $words ($temp);

and it should be clearer. Perl is treating $words as an indirect
object -- a file handle to print $temp to. Hence the error message
"can't use an undefined value as a symbol reference", since Perl is
expecting a symbol in that slot.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Thu, 22 Mar 2001 08:05:35 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Can't combine > and $
Message-Id: <1kcjbt0hkl367chuh9klp247bt8migkq86@4ax.com>

John W. Krahn wrote:

>> The three-argument version of open would be better:
>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>Really? Did you compile your own version of Perl with this feature
>added?
>
>
>>     open(OUT, ">", "$_/scripts/make_mask.txt")
>
>Too many arguments for open at -e line 1, near
>""$_/scripts/make_mask.txt")"
>Execution of -e aborted due to compilation errors.

This is in perldelta for 5.6.0:

  open() with more than two arguments

    If open() is passed three arguments instead of two, the second
    argument is used as the mode and the third argument is taken to be
    the file name.

-- 
	Bart.


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

Date: Thu, 22 Mar 2001 09:09:48 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Can't combine > and $
Message-Id: <3AB9C2FE.69578100@acm.org>

Joe Schaefer wrote:
> 
> "John W. Krahn" <krahnj@acm.org> writes:
> 
> > Richard Kennaway wrote:
> > >
> > > In article <E0Ps6.73$ez4.3092@eagle.america.net> Garry Williams,
> > > garry@zvolve.com writes:
> > > > open(OUT, ">$_/scripts/make_mask.txt")
> > > >     || die "can't open $_/scripts/make_mask.txt: $!\n";
> > >
> > > The three-argument version of open would be better:
> >       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> > Really? Did you compile your own version of Perl with this feature
> > added?
> 
> Maybe so.
> 
> > >     open(OUT, ">", "$_/scripts/make_mask.txt")
> >
> > Too many arguments for open at -e line 1, near
> > ""$_/scripts/make_mask.txt")"
> > Execution of -e aborted due to compilation errors.
> 
>   % perl -ce 'open(OUT, ">", "$_/scripts/make_mask.txt")'
>   Too many arguments for open at -e line 1, at end of line
>   -e had compilation errors.
>   % /usr/local/bin/perl -ce 'open(OUT, ">", "$_/scripts/make_mask.txt")'
>   -e syntax OK
>   % /usr/local/bin/perl -v
> 
>   This is perl, v5.6.0 built for i586-linux
>   ...
> 
> (It actually works just as Richard advertised on my 5.6).

Yes, and he also claims that it "would be better." Is this also true?


John
-- 
use Perl;
program
fulfillment


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

Date: 22 Mar 2001 09:27:20 GMT
From: Richard Kennaway <jrk@sys.uea.ac.uk>
Subject: Re: Can't combine > and $
Message-Id: <99cgho$4m8$1@cpca14.uea.ac.uk>

In article <3AB9568A.997C55B5@acm.org> John W. Krahn, krahnj@acm.org
writes:
>Richard Kennaway wrote:
>> The three-argument version of open would be better:
>      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>Really? Did you compile your own version of Perl with this feature
>added?

No.  It's there as standard, at least for Perl 5.6.0 on iris4d-irix, and
Dynamic Perl and Active Perl 5.6.0 on Windows.  It is also documented in
perldoc -f open.

It's not there in 5.005_02 built for sun4-solaris, but I can't think of
any reason to still be running that (as I keep telling the support staff
responsible for that machine...)

Actually, perldoc reports the three-arg version as

          open FILEHANDLE,MODE,LIST

suggesting it can take any number of arguments, but it does not say what,
if anything, is done with arguments after the third.  Perhaps that line
is in error.

-- Richard Kennaway, jrk@sys.uea.ac.uk, http://www.sys.uea.ac.uk/~jrk/
   School of Information Systems, Univ. of East Anglia, Norwich, U.K.


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

Date: Thu, 22 Mar 2001 10:27:22 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Can't combine > and $
Message-Id: <etkjbts9m42dbm5blslkifn3i4695ft98q@4ax.com>

John W. Krahn wrote:

>> > >     open(OUT, ">", "$_/scripts/make_mask.txt")

>> (It actually works just as Richard advertised on my 5.6).
>
>Yes, and he also claims that it "would be better." Is this also true?

Try opening a file of which the name starts or ends in a space, and
you'll soon be convinced.

-- 
	Bart.


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

Date: 22 Mar 2001 08:38:45 +0000
From: nobull@mail.com
Subject: Re: Capturing both STDOUT and STDERR from `ls` ?
Message-Id: <u9bsqujgvq.fsf@wcl-l.bham.ac.uk>

Eric Goodill <ericg@redback.com> writes:

FAQ: "How can I capture STDERR from an external command?"

> I have looked around some, but I couldn't find a way to capture both
> STDOUT and STDERR from a backtick invocation of a command.

I think you need to refine your "looking around" algorithm to incluide
the FAQ.

> I figure there must be a way (it is perl after all).  In fact there must
> be multiple ways to do it...

Yes, and although the FAQ lists several it does not mention the IPC::Open3
module.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 22 Mar 2001 08:19:09 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: CGI redirect implementation
Message-Id: <3ab9b0a1.3851918@news.grnet.gr>

On Wed, 21 Mar 2001 21:34:29 -0800, Yuriy Tenenbaum
<yuriyt@ix.netcom.com> wrote:

>To finalize - i have a form... i want to print the entered information
>on another page and ask user to confirm... i had to use headers on the
>original form, so i can't redirect... What do i do?  How do people
>normally jump from the form to "confirmation" page?

You don't write the confirmation page to a file and then redirect. You
read the input data from the form using:

my $parameter = $query->param('parameter');

as I assume you're already doing. Then you output the new page
directly to the user's browser from your script by printing the HTML
with the data interpolated as variables.

You should probably also look into HERE documents. perlfaq4 has an
entry about this. I find it rather obtuse myself, but it may help you.
Here's a short example:

print <<FOO;

You entered the following data:

	Name: $name
	E-mail: $email

 ... etc.

FOO

All the text between the <<FOO; and the FOO will be printed as you
have typed it. The values of $name and $email will be substituted when
the script is executed.

Note that the last FOO (or whatever) must be on its own at the start
of the line, with no tabs or spaces or anything at all after it..

HTH

Phil
--
@x=split//,'Just another Perl decoder,';split//,'*'x@x;%i=split/=/,
'AA=a=aa= =1=,';for$i(0..$#x){$_[$i]=chr($=+5);while($_[$i]ne$x[$i])
{$_[$i]=$i{$_[$i]}if$i{++$_[$i]};print@_,"\r";while(rand!=rand){}}}
Ignore coming events if you wish to send me e-mail


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

Date: Thu, 22 Mar 2001 08:58:19 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: CGI redirect implementation
Message-Id: <rlfjbt86b19j5a6udd8r7ul77n3ba352n9@4ax.com>

Yuriy Tenenbaum wrote:

>When user submits the information, i
>want to print that information on a clean page and ask the user to
>"confirm" the entered information.  Obviously in order to create an
>original form i must have used headers....  QUESTION - how do i redirect
>the user to the confirmation page?

You don't. You simply let the CGI script spit out the confirmation page.
It needn't be the same script you use for everything, but make sure that
your form's ACTION URL points to THIS script.

-- 
	Bart.


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

Date: Thu, 22 Mar 2001 11:14:49 +0100
From: Jan Gruber <me@dev.null>
Subject: Re: CGI redirect implementation
Message-Id: <99cj3s$c5q$1@news.intern.primacom.net>

Yuriy Tenenbaum wrote:

> To finalize - i have a form... i want to print the entered information
> on another page and ask user to confirm... i had to use headers on the
> original form, so i can't redirect... What do i do?  How do people
> normally jump from the form to "confirmation" page?

I tried to do that with pure HTML, but after some time i found out, its 
easier to use Javascript for that.

This little code snippet displays a Confirm dialog. If ok, it redirects to 
your new URL; if not, it goes back in the browser history to your original 
page.

 .
 .
$x = new CGI;
$querystr = $x->query_string;

print " Content-Type: text/html\
\
\
<html>
<head>
<script language=javascript>
function blah(){

EOF

    print "  if (true==confirm(\"Put your text in here\")){\
  window.location.href = 'http://somescript.cgi\?$querystr'";

    print <<EOS;
  } else {
  
   history.back ();
  
  }
}
</script>
</head>
<body onload="blah()">
</BODY>
</HTML>

EOS

Have the form post its content to the script containing his code, save the 
query string and post this query string to the script you want to call.

HTH,

Jan
-- 
cat /dev/world | perl -e "(/(^.*? \?) 42 \!/) && (print $1))"
errors->(c)
_ 



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

Date: Thu, 22 Mar 2001 10:05:15 +0000
From: Mark Grimshaw <m.grimshaw@salford.ac.uk>
Subject: Re: checkbox problem
Message-Id: <3AB9CE5B.25A48501@salford.ac.uk>


--------------09DF9FD0D03A136DF355DA8A
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Checkboxes named with the same NAME parameter, can be collected in an array.

You might be able to do it with:
@whotocheckboxes = $in{whotocheckboxes"};

although I haven't checked it.


I usually use something like (although I use CGI.pm and hence $in->param for
me):

foreach $key($in)
{
    next if($key eq 'alreadygotthis');
    etc..
    push(@whotocheckboxes, $key);
}

To return this array back to another web page, you probably need to join() the
array into one string before attaching it to your A HREF= depending on what
you want to do with it.


uNcONvEntiOnaL wrote:

> Here is a snippet from a script that gets input from a html form.
>
> $phone = $in{"phone"};
> $whotocheckboxes = $in{"whotocheckboxes"};
>
> phone is a textbox, whotocheckboxes is a checkbox array.
> The values of phone and the checkbox array (multiple if multiple
> ones are checked) need to be passed to another web page.
>
> print "<a HREF='http://www.sasha.com/contact2.html?phone=$phone&
> whotocheckboxes=$whotocheckboxes'>Return</a>\n";
>
> whotocheckboxes only has one value in it, it doesn't remember
> all the checked boxes.  Does someone know what else I need
> to add to capture and pass on all chosen checkboxes?
>
> Thanks    Tom
>
> --
> On the Hiway to Hell...             //    www.informationhiwaytohell.com
> The Information Hiway to Hell...  AC\\DC   tomcat@visi.com  uNcONvEntiOnaL
>                                     //
>     When encryption is made illegal, then *7^%,"JJr3%a}Z@9((l:^%$Hhr=+!

--------------09DF9FD0D03A136DF355DA8A
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Checkboxes named with the same NAME parameter, can be collected in an array.
<p>You might be able to do it with:
<br>@whotocheckboxes = $in{whotocheckboxes"};
<p>although I haven't checked it.
<br>&nbsp;
<p>I usually use something like (although I use CGI.pm and hence $in->param
for me):
<p>foreach $key($in)
<br>{
<br>&nbsp;&nbsp;&nbsp; next if($key eq 'alreadygotthis');
<br>&nbsp;&nbsp;&nbsp; etc..
<br>&nbsp;&nbsp;&nbsp; push(@whotocheckboxes, $key);
<br>}
<p>To return this array back to another web page, you probably need to
join() the array into one string before attaching it to your A HREF= depending
on what you want to do with it.
<br>&nbsp;
<p>uNcONvEntiOnaL wrote:
<blockquote TYPE=CITE>Here is a snippet from a script that gets input from
a html form.
<p>$phone = $in{"phone"};
<br>$whotocheckboxes = $in{"whotocheckboxes"};
<p>phone is a textbox, whotocheckboxes is a checkbox array.
<br>The values of phone and the checkbox array (multiple if multiple
<br>ones are checked) need to be passed to another web page.
<p>print "&lt;a HREF='<a href="http://www.sasha.com/contact2.html?phone=$phone&">http://www.sasha.com/contact2.html?phone=$phone&amp;</a>
<br>whotocheckboxes=$whotocheckboxes'>Return&lt;/a>\n";
<p>whotocheckboxes only has one value in it, it doesn't remember
<br>all the checked boxes.&nbsp; Does someone know what else I need
<br>to add to capture and pass on all chosen checkboxes?
<p>Thanks&nbsp;&nbsp;&nbsp; Tom
<p>--
<br>On the Hiway to Hell...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//&nbsp;&nbsp;&nbsp; www.informationhiwaytohell.com
<br>The Information Hiway to Hell...&nbsp; AC\\DC&nbsp;&nbsp; tomcat@visi.com&nbsp;
uNcONvEntiOnaL
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
//
<br>&nbsp;&nbsp;&nbsp; When encryption is made illegal, then *7^%,"JJr3%a}Z@9((l:^%$Hhr=+!</blockquote>
</html>

--------------09DF9FD0D03A136DF355DA8A--



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

Date: Thu, 22 Mar 2001 10:30:46 +0100
From: "Mark Kuin" <mkuin@globalrangers.com>
Subject: Re: DBI and Activestate's perlapp
Message-Id: <99ch60$df4$1@news1.xs4all.nl>

> Activestate's 'perlapp' is really cool which allows you to turn perl
scripts
Why don't you ask Activestate to solve the problem or a workaround for the
problem? This does not seem to be a perl related question...

hth Mark





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

Date: Thu, 22 Mar 2001 18:20:39 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: Help determining ShockwaveFlash h & w?
Message-Id: <apiu6.1102$45.4485@newsfeeds.bigpond.com>

As a general rule, you can download Perl modules from CPAN to your local ISP
account/directoey and, provided they are in your path, use them there.

gtoomey

-----------
"xris" <user@host.com> wrote in message
news:user-9A70F2.00565022032001@newsrump.sjc.telocity.net...
> A possible new client is interested in using flash instead of gif/jpeg
> on his site.  Currently, I have a web-based form for allowing users to
> upload images, and autodetect both the file type and the height & width
> of the uploaded files.  I've searched all over for any easy way to do
> this same thing with Flash files, and have wracked my brain with hex
> dumps of several .swf files but with no luck (I'm just not that good at
> hacking file formats)..
>
> I'm hoping that someone out there in the perl world has come up with an
> easy solution that can be integrated with my software (my isp won't
> install new perl modules).
>
> Thanks,
>
> Chris
>
> (ps. please reply here, I get too much spam to trust using a real email
> address in newsgroup posts)




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

Date: Thu, 22 Mar 2001 08:26:13 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Help determining ShockwaveFlash h & w?
Message-Id: <28djbtot22s40jjjuhnjivecj9nbmbsioh@4ax.com>

xris wrote:

>A possible new client is interested in using flash instead of gif/jpeg 
>on his site.  Currently, I have a web-based form for allowing users to 
>upload images, and autodetect both the file type and the height & width 
>of the uploaded files.  I've searched all over for any easy way to do 
>this same thing with Flash files, and have wracked my brain with hex 
>dumps of several .swf files but with no luck (I'm just not that good at 
>hacking file formats)..
>
>I'm hoping that someone out there in the perl world has come up with an 
>easy solution that can be integrated with my software (my isp won't 
>install new perl modules).

I'd say: tough luck. The above combination is lethal. People just
mustn't expect fully professional results in a crippled environment.

So don't use height and width for flash files, and the browser will
display it properly, maybe after some hickups.

If you insist, you might be interested in the fact that some people have
been working on perl modules to generate Flash files. Check out
<http://2shortplanks.com/flash/>

And I see they seem to have some competition:

<http://www.sabren.net/code/flashperl/>

-- 
	Bart.


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

Date: Thu, 22 Mar 2001 09:52:32 +0100
From: Christoph Neubauer <christoph.neubauer@siemens.at>
Subject: Re: how do you pass arguements into the "do" command?
Message-Id: <3AB9BD50.FB93A0A5@siemens.at>



David wrote:

> I'm trying to pass an arguement into a perl program that I am
> executing from another Perl program. I try:
>
> do "program.plx data1";
>
> It doesn't work. It doesn't do anything that I can see.
>
> do "program.plx";
>
> works fine, but doesn't accomplish what I want.
>
> Can you pass arguements in with the "do" command?
> Is there a simple way to accomplish this otherwise?
>
> I've tried within a program:
>
> system("perl program.plx data1");
>
> This worked when in the Perl directory from the command line but did
> NOT work when I tried to execute it from a web page. Don't know the
> reason but I assume it has something to do with the environment.  I'd
> like to know how to make this work as well. Can't identify the
> environment element that is relevant here.
>
> I'd appreciate any help. -- Dave (dsedrich@yahoo.com)

Have you ever tried with: `program.plx data1`;
First line of program.plx should be: #!perl -w
Anyway it should be better to call program.plx with its full path.

Hope that helps,
Chris



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

Date: Thu, 22 Mar 2001 09:52:51 +0100
From: Christoph Neubauer <christoph.neubauer@siemens.at>
Subject: Re: how do you pass arguements into the "do" command?
Message-Id: <3AB9BD63.2B814010@siemens.at>



David wrote:

> I'm trying to pass an arguement into a perl program that I am
> executing from another Perl program. I try:
>
> do "program.plx data1";
>
> It doesn't work. It doesn't do anything that I can see.
>
> do "program.plx";
>
> works fine, but doesn't accomplish what I want.
>
> Can you pass arguements in with the "do" command?
> Is there a simple way to accomplish this otherwise?
>
> I've tried within a program:
>
> system("perl program.plx data1");
>
> This worked when in the Perl directory from the command line but did
> NOT work when I tried to execute it from a web page. Don't know the
> reason but I assume it has something to do with the environment.  I'd
> like to know how to make this work as well. Can't identify the
> environment element that is relevant here.
>
> I'd appreciate any help. -- Dave (dsedrich@yahoo.com)

Have you ever tried with: `program.plx data1`;
First line of program.plx should be: #!perl -w
Anyway it should be better to call program.plx with its full path.

Hope that helps,
Chris



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

Date: 22 Mar 2001 08:53:54 +0000
From: nobull@mail.com
Subject: Re: how do you pass arguements into the "do" command?
Message-Id: <u97l1ijgm7.fsf@wcl-l.bham.ac.uk>

dsedrich@yahoo.com (David) writes:

> I'm trying to pass an arguement into a perl program that I am
> executing from another Perl program. I try:
> 
> do "program.plx data1";
> 
> It doesn't work. It doesn't do anything that I can see.
> 
> do "program.plx";
> 
> works fine, but doesn't accomplish what I want.
> 
> Can you pass arguements in with the "do" command?

No, but...

{
  local *ARGV;
  @ARGV = ('data1');
  do "program.plx";
}

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 22 Mar 2001 08:35:54 +0000
From: nobull@mail.com
Subject: Re: How do/Can I ... A question on shared libraries.
Message-Id: <u9d7bajgwl.fsf@wcl-l.bham.ac.uk>

Blair Dean <blair_dean@hc-sc.gc.ca> writes:

> Can I find out if a Perl installation was built to use shared libraries
> and if so, where those libraries would reside?

Perl build options are displayed using 'perl -V'.

To find out what shared libraries a compiled executable uses there
should be a host OS tool.  For example on Linux and many other
flavours of Unix you'd do:

$ ldd /usr/bin/perl
	libnsl.so.1 => /lib/libnsl.so.1 (0x4001e000)
	libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x40035000)
	libdb.so.3 => /lib/libdb.so.3 (0x4003c000)
	libdl.so.2 => /lib/libdl.so.2 (0x4007a000)
	libm.so.6 => /lib/libm.so.6 (0x4007e000)
	libc.so.6 => /lib/libc.so.6 (0x4009b000)
	libcrypt.so.1 => /lib/libcrypt.so.1 (0x4017f000)
	/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
 
-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 22 Mar 2001 08:51:17 +0000
From: nobull@mail.com
Subject: Re: How to find the existence of an array variable?
Message-Id: <u9ae6ejgui.fsf@wcl-l.bham.ac.uk>

Jagan Mohan K <jmohan1@ascend.com> writes:

>   Any idea how to find the whether a variable exists or not in Perl?
> What I mean is a command something like  [info exists a ] checks for
> existence of the variable in Tcl.

I think you are probably asking the wrong question.  Can you explain
why it is that you that think you want to know?

I don't think I've never encountered a situation where I wanted to
know.  I often want to know if an array has content but I've never
needed to check if the array itself exists.

Anyhow, as others have pointed out, the answer to the question you
asked is defined().

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 22 Mar 2001 18:26:59 +1000
From: "Gregory Toomey" <gtoomey@usa.net>
Subject: Re: Newbie : Can I open a file from another web server ?
Message-Id: <5viu6.1104$45.3722@newsfeeds.bigpond.com>

Something like the following should work:

use LWP::Simple;
$resp = get('http://www.anothersite.com/folder/filename.txt');

--------------
"Dave Cross" <dave@dave.org.uk> wrote in message
news:hi0ibtor0f7am8nie842haih4pduqlhncn@4ax.com...
> On Wed, 21 Mar 2001 19:22:50 -0000, "Martin J Steven"
> <mart@markel.demon.co.uk> wrote:
>
> >This may seem a strange question but can I open a file that's not located
on
> >the server where the script runs - ie instead of opening it from the
local
> >cgi-bin folder give it a full path to another site (eg
> >http://www.anothersite.com/folder/filename.txt).  I only want to read the
> >file.
>
> Look at the libwww bundle of modeule on CPAN - specifically
> LWP::Simple.
>
> Dave...
>
> --
> <http://www.dave.org.uk>  SMS: sms@dave.org.uk
> <http://www.manning.com/cross/>




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

Date: Thu, 22 Mar 2001 08:56:05 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: passing two arrays two a sub
Message-Id: <tefjbt00bq4epa09kj2ji947eok1t416t3@4ax.com>

Allan M. Due wrote:

>He didn't want the sub work to
>modify the original arrays.  I didn't have time to look at the code and after
>thinking about it for a sec I came up with:
>
> @{shift @_};
>
>Just curious if there are any gotchas.

Yes. This isn't actually a deep copy. You create an array with copies of
the elements, and it works properly for ordinary scalars, but not for
reference: the copy of the reference still points to the same, original,
structure! So if you have complex, nested data structures, it is still
possible to modify the original data.

-- 
	Bart.


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

Date: 22 Mar 2001 10:33:01 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: Perl 5.6 - Spinning cursor routine?
Message-Id: <slrn9bjl64.s22.damian@puma.qimr.edu.au>

Joe Schaefer chose 22 Mar 2001 01:27:18 -0500 to say this:
>damian@qimr.edu.au (Damian James) writes:
>
>> ...
>>     return sub {
>>         local $| = 1;
>          ^^^^^
>
>...  IMHO it's 
>less confusing to leave off the 'local' declaration 
>in this code, or alternatively move the print statement
>inside the closure.
>

Or indeed, put $| = 1; before the call to make the closure, or anywhere
else outside the closure. 

I had tested this with the print() inside the closure, but for some reason
(call it the jitters or whatever) decided it was better outside. I thought
maybe the OP's code would fit better with the buffering unchanged, but
hadn't thought ahead enough to see that any printing the OP does to stdout
would break the twiddle anyway :-). So may as well make $| global -- the
program is presumably interactive anyway, if the OP wants it to twiddle.

>
>Hope I'm not being too nitpicky, but I appreciated it
>when Uri pointed this out before.
>

Not at all -- I appreciate it too (haven't been around here for long enough
to have seen Uri's post first hand). I hadn't realised what the effect
(autoflushing the *previous* loop iteration) would be. 

Thanks for pointing this out, and all that.

Cheers,
Damian
-- 
@;=0..23;@;{@;}=split//,<DATA>;while(@;){for($;=@;;--$;;){next if($:=rand($;
+1))==0+$;;@;[$;,$:]=@;[$:,$;]}print map{$;{$_}}(@| ,@;);push@|,shift@;if$;[
0]==@|;$|=1;select$&,$&,$&,1/80;print"\b"x(@;+@|)}print"\n"__END__
Just another Perl Hacker


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

Date: Thu, 22 Mar 2001 11:26:02 +0100
From: Philip Newton <pne-news-20010322@newton.digitalspace.net>
Subject: Re: Perl FAQ?
Message-Id: <2pkjbts7iqca1vdl1d187ahbi2g45u44pb@4ax.com>

On Fri, 16 Mar 2001 10:15:23 -0600, Michael Carman <mjcarman@home.com>
wrote:

> If the newsgroup is so full of FAQs that they can't find the novel,
> interesting, even challenging ones that they would like to answer, they
> leave. Who helps the newbies then?

alt.perl?

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: 22 Mar 2001 11:04:04 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Perl FAQ?
Message-Id: <99cm74$21t$2@bob.news.rcn.net>

Philip Newton <pne-news-20010322@newton.digitalspace.net> wrote:
> On Fri, 16 Mar 2001 10:15:23 -0600, Michael Carman <mjcarman@home.com>
> wrote:

>> If the newsgroup is so full of FAQs that they can't find the novel,
>> interesting, even challenging ones that they would like to answer, they
>> leave. Who helps the newbies then?

> alt.perl?

FSVO "help."



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

Date: Thu, 22 Mar 2001 10:08:59 +0000
From: Mark Grimshaw <m.grimshaw@salford.ac.uk>
Subject: Re: persistent cookie working with Netscape4.7x, not IE5x?
Message-Id: <3AB9CF3B.AA5A82F@salford.ac.uk>

Thanks John,

Integration did the trick.


John Hall wrote:

> I think I may have had a problem with strict when calling a subroutine in
> something that was 'require'd and not 'use'd..
>
> The simple solution is to integrate the functions in that cookie.lib file
> into your script..
>
> The correct solution would probably be if I could remember how to get around
> that strict problem.. which I can't.
>
> "Mark Grimshaw" <m.grimshaw@salford.ac.uk> wrote in message
> news:3AB90411.4B6F903F@salford.ac.uk...
> > Hi,
> >
> > Hmm I must be stupid.  Downloaded, untarred, chmodded +x, added require
> > '/path/cookie.lib' and end up with messages such as undefined subroutine
> > SetCookiePath etc.
> >
> > John Hall wrote:
> >
> > > I had similar problems until I started using the 'simple' cookie.lib
> that
> > > matt's script archive has:
> > >
> > > http://www.worldwidemart.com/scripts/
> > >
> > > I 'require' it, then all I have to do is this:
> > >
> > > &SetCookies('cookiename','cookieval')
> > >
> > > Also, check to make sure the exp date is far off.. [in the cookie.lib
> > > somewhere]
> > >
> > > $Cookie_Exp_Date = 'Wed, 08-Jun-2011 00:04:11 GMT';
> > >
> > > "Mark Grimshaw" <m.grimshaw@salford.ac.uk> wrote in message
> > > news:3AB8F65C.D8A430C8@salford.ac.uk...
> > > > Using the Set-Cookie header within a perl script, I can set and get
> > > > persistent cookies with Netscape.
> > > >
> > > > With IE5, I can set the cookie (i.e. I can see and read the cookie on
> my
> > > > client hard drive) but cannot get the cookie back.
> > > >
> > > > Netscape properly sends the HTTP_COOKIE environmental back to the perl
> > > > script from which I can retrieve the state information.
> > > >
> > > > IE5 does not sent HTTP_COOKIE at all.
> > > >
> > > > Any ideas?
> > > >
> >



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

Date: Thu, 22 Mar 2001 10:58:04 +0100
From: "novax" <franck01@noos.fr>
Subject: Resize and save an image
Message-Id: <99chqa$etm$1@wanadoo.fr>

hello
i want to resize and save a Jpg image on my server with a ratio
Does anyone know a script for this .
please i want a very simple perl script

franck
thanks




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

Date: Thu, 22 Mar 2001 11:38:41 +0100
From: Philip Newton <pne-news-20010322@newton.digitalspace.net>
Subject: Re: Why do "Learning Perl" Books Do This? A Subroutine Question.
Message-Id: <0gljbtkr4t93to6hkvpcpab758nkp026tn@4ax.com>

On Tue, 20 Mar 2001 13:16:04 -0500, brian d foy <comdog@panix.com>
wrote:

> In article <zQit6.314$587.24872@typhoon.ne.mediaone.net>, "David 
> Ehrens" <nospam@nospam.net> wrote:
> 
> > "Randal L. Schwartz" <merlyn@stonehenge.com> wrote in message
> > news:m1g0game7y.fsf@halfdome.holdit.com...
> 
> > > The first edition of the Learning Perl book doesn't mention splice()
> > > even in the slightest.  I'd know.  Perhaps you're confusing my book
> > > with another.
> 
> > > That makes your entire comment suspect.  Reader beware.
> 
> > Well, sorry I hurt your feelings, but the section I mention was in the
> > "camel" book with the pink spine, ISBN 0-937175-64-1 (March 1992), pages
> > 13-20. I don't think readers need to worry about MY honesty.
> 
> it seems we do.  the book to which you refer is not "Learning Perl".

David Ehrens didn't mention the title "Learning Perl" -- Randal
brought it up since he thought he recognised what book David was
talking about. David called it "the first edition of the Perl book by
Larry Wall and Randal Schwartz".

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
Yes, that really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Thu, 22 Mar 2001 08:07:16 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Words in a String variable
Message-Id: <slrn9bjcln.281.rgarciasuarez@rafael.kazibao.net>

Daniel Wetzler wrote in comp.lang.perl.misc:
> Hallo,
> 
> I'm a newbie and want to extract words from a String variable.
> 
> A string looks for example like this :
> 
> $string = "Ammonium tartrate (lab)";
> 
> I would like to recognize each word (Ammonium, tartrate, (lab)) and put 
> them into
> different variables
> 
> $string1 = "Ammonium"
> $string2 = "tartrate"
> $string3 = "(lab)"

my ($string1,$string2,$string3) = split /\s+/, $string;

or better, store words in an array :

my @words = split /\s+/, $string;

> I tried this for hours but I fear i don't have enough docu about regular 
> expressions.

Strange, you mean that you don't have Perl installed? Or didn't you
notice that Perl comes with several megabytes of standard documentation?

-- 
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 547
**************************************


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