[15790] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3203 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 30 09:05:45 2000

Date: Tue, 30 May 2000 06:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <959691912-v9-i3203@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 30 May 2000     Volume: 9 Number: 3203

Today's topics:
        [Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
        [question] this newsgroup relayed by email or such ... <david.paquet@free.fr>
    Re: a really unusual prompt on remote host <rhomberg@ife.ee.ethz.ch>
    Re: Basic scripting question <nospam@devnull.com>
    Re: casting? (Rafael Garcia-Suarez)
    Re: couple of beginner questions <sue@pennine.com>
    Re: couple of beginner questions <flavell@mail.cern.ch>
        Extracting info from variable <robert@pharmapartners.nl>
    Re: Extracting info from variable (jason)
        help newbie : how to count line into a txt file <olivier.laurent@archangelis.com>
    Re: How Sambar 4.2 run CGI ? <nospam@devnull.com>
        how to redirect input <wake@thukraine.com>
    Re: how to redirect input (Neil Kandalgaonkar)
    Re: how to set the filename when sending content of unk nobull@mail.com
        Image::Magick installation error, please help irpag@gmx.net
        Is Perl for me? <peterhardingNOpeSPAM@yahoo.com.invalid>
        modify the environment variables permanently via Perl <a.voerg@ieee.org>
    Re: modify the environment variables permanently via Pe <blah@nospam.com>
    Re: my $x vs. my ($x) <nospam@devnull.com>
    Re: newbie question - dbi:mysql <rhardicr@ford.com>
    Re: Newbie: Pattern Match Question (Neil Kandalgaonkar)
    Re: No Flash (Gwyn Judd)
    Re: oops Re: seeking method to encode email addresses i <nospam@devnull.com>
    Re: Perl forking question (multiple times) <sue@pennine.com>
    Re: Perl unusable as a programming language (Malcolm Dew-Jones)
    Re: Perl unusable as a programming language (Simon Cozens)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 30 May 2000 10:22:51 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage959682241.28691@news.teleport.com>

Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 29 Apr 2000

[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last _major_ update of the Perl FAQ was in Summer
of 1998; of course, ongoing updates are made as needed. ]

For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).

    http://www.cpan.org/doc/FAQs/

Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.

For an alternative way to get answers, check out the Perlfaq website.

    http://www.perlfaq.com/

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.

    perldoc perlfaq
    man perlfaq

If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.

If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.

    http://www.cpan.org/
    http://www.perl.com/CPAN/
    http://www.cpan.org/doc/FAQs/FAQ/html/
    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/

You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)

    California     ftp://ftp.cdrom.com/pub/perl/CPAN/
    Texas          ftp://ftp.metronet.com/pub/perl/
    South Africa   ftp://ftp.is.co.za/programming/perl/CPAN/
    Japan          ftp://ftp.dti.ad.jp/pub/lang/CPAN/
    Australia      ftp://cpan.topend.com.au/pub/CPAN/
    Netherlands    ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
    Switzerland    ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
    Chile          ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/

If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.

Have fun with Perl!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


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

Date: Tue, 30 May 2000 12:43:36 GMT
From: David PAQUET <david.paquet@free.fr>
Subject: [question] this newsgroup relayed by email or such ...
Message-Id: <3933B915.AE173EF5@free.fr>

Hi fellow Perl fans,

One of my friend only has email connectivity (no http, no nntp...) to the
Internet. He is into Perl and he'd like to stay informed and get answers to his
questions about this wonderful language. So I ask you on his behalf whether
there is a news to email gateway service available somewhere for this newsgroup.
I have also looked at various Perl sites to see if there was a relevant
mailing-list (I mean general discussion about Perl, like in this newsgroup) but
I couldn't find any (yes, there are several Perl related lists but none with
such a general topic).

So I hope my question is now clear : where to find info about Perl, generally
speaking, by email.

Please CC: to my email if you feel like replying. Thank you and long live to
Perl !

--
gdon


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

Date: Tue, 30 May 2000 13:30:03 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: a really unusual prompt on remote host
Message-Id: <3933A63B.51386370@ife.ee.ethz.ch>

Edward Grinvald wrote:
> 
> Hi,
> I want to use Net::Telnet (installed and confirmed with a different host) to
> do some stuff on a remote host. The problem is that the remote host doesn't
> immideatly go into a shell, but instead throws up an arrow-buttons driven
> menu (mail, account, news....). I have to enter ! to get to the prompt. So,
> my scripts die with "timed out waiting for prompt at line xxx." Any ideas?

You should supply a bit more information. My PSI::ESP module tells me
that the scripts die when you call the login() method.

Before you login(), change the prompt to whatever asks you to enter '!'.
When login returns, you know that the machine is waiting in the menu,
change the prompt back to the expected command line and cmd('!').

Another possibility would be to use print() and get() methods until you
know the prompt you wait for.

- Alex


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

Date: 30 May 2000 10:38:43 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: Basic scripting question
Message-Id: <8h05nj$1r6$0@216.155.32.164>

In article <392EA783.43A11A30@stomp.stomp.tokyo>, "Godzilla!" 
<godzilla@stomp.stomp.tokyo> wrote:

 | The WebDragon wrote:
 | > 
 | > "Godzilla!" <godzilla@stomp.stomp.tokyo> wrote:
 | 
 | >  | Except for one thing; it doesn't work right.
 |  
 | > not only does it work, but it even works on MY MACINTOSH
 | 
 | > *smiles sweetly.. gradually morphing into a maniacal grin*
 | 
 | Review the entire thread on this code
 | in question Mr. Dragon. I believe you
 | have a bassackwards notion on this.

Heya Godzilla,

Um, 'fraid not. 

(just to be completely certain of my standpoint on this I went to 
www.deja.com/usenet/ and searched for basic +scripting +question, and 
then switched to thread view and read the entire thread from the 
beginning again)


Allow me to reiterate --> This works fine on the Mac:

    perl -ne "print if $. % 3" input_file

From a Unixish command line, these might be better: (again this is NOT 
#!perl code)

    perl -ne "print if $. % 3" <input_file >output_file
or
    perl -ne "print unless $. % 3" <input_file >output_file

top two hacks out every 3rd line, the third hacks everything BUT every 
third line. 

(interestingly enough the >output_file redirecty-thing doesn't work with 
the Mac one-liners .. it creates the file, but prints to stdout. It's 
(MacPerl 520r4 (essentially 5.004)) long overdue for an update to more 
recent perl versions anyway so I'm not worryinbg overmuch about that as 
I don't need this particular feature at the moment, and OSX will have 
native perl anyway.)

Both of these function perfectly as perl one-liners run from the 
*command line* (again, NOT within a perl script that starts with 
#!/path/to/perl).

if you wanted to be really pedantic and do THAT you could do 

#!perl
open(IN, "<input_file") || die ("Can't find input file $!");
open(OUT, ">output_file") || die("Can't open output file $!");
while (<IN>) {
    if ($. % 3) {
        print OUT $_;
    }
} 

However, the command line option is FAR more elegant, IF that's all you 
need. :)

Are you trying to tell me that I, as a Macintosh (which HAS NO COMMAND 
LINE, PERIOD) user, figured out how to use perl one-liners before you, 
with your whatever-it-is-you-have-to-run-perl-with, did? 

I'm not sure whether to be very very frightened or to chuckle heartily 
and point you to perldoc -f perlrun. 

HTH! :)

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Tue, 30 May 2000 07:37:23 GMT
From: garcia_suarez@hotmail.com (Rafael Garcia-Suarez)
Subject: Re: casting?
Message-Id: <slrn8j6s42.kag.garcia_suarez@rafael.kazibao.net>

Neil Macneale wrote in comp.lang.perl.misc:
>Hi all!
>
>I am new to the world of PERL, and I seem to have missed something in the
>Camel book.  How do I cast something?  I want to read in a character from
>a file, then print the decimal value of the byte written.  I know how to
>do it in C,  so I figured I would just cast the scalar as an (int) but
>PERL didn't like that at all.  I tryed printf with no luck,  and I tryed
>the int() function which didn't work either.  What am I missing?

There is no such thing as a cast in Perl. You don't need it, as Perl does
not make a difference between strings, characters, integers and floating
point numbers.

To get the ASCII value of a character, use ord:

% perl -e 'print ord "A"'
65
% perldoc -f ord


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

Date: 30 May 2000 01:07:17 -0700
From: Sue Spence <sue@pennine.com>
Subject: Re: couple of beginner questions
Message-Id: <8gvsrl$1gg@drn.newsguy.com>

In article <8gvftp$hf4$1@nnrp1.deja.com>, ldkramer@my-deja.com says...
>
>Hello, I have two questions that I haven't been able to find the
>answers to.  Hope someone can help!
>
>1. Is it possible to write a CGI script that doesn't make the browser
>display any new HTML when it's done running?  I keep seeing references
>to CGI scripts that either spit out some HTML (that wipes out what was
>in the browser window) or that redirect the browser to some other
>page.  I can't figure out how to just "do nothing" when the CGI script
>is done.

comp.infosystems.www.authoring.cgi is probably the best place to ask that
question.


>2. On Macintosh using Internet Explorer, when you use the file upload
>form element, the file that is sent up to the server has all of this
>additional information at the beginning and end.  I don't know alot
>about the Macintosh OS but I think that it is being sent up in
>MacBinary format where the file's resource fork information gets
>embedded into the file.(?)  This is a problem if you want to use this
>uploaded file in a web page because this extra info makes the file
>unreadable by the browser.  How to people deal with this?  Do I write
>Perl code that will strip this extra information out of the file?  If
>so, anyone happen to have such code?
>

comp.infosystems.www.authoring.cgi again, and/or a mac group as well.  If you do
find you need a Perl script and you need help with it, then check back with us!
;-)



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

Date: Tue, 30 May 2000 12:34:23 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: couple of beginner questions
Message-Id: <Pine.GHP.4.21.0005301226360.23031-100000@hpplus01.cern.ch>

On Tue, 30 May 2000 ldkramer@my-deja.com wrote:

> 1. Is it possible to write a CGI script 

Is it possible to find the comp.infosystems.www.authoring.cgi group
and its FAQ resources?

> that doesn't make the browser
> display any new HTML when it's done running? 

"Can I run a CGI script without returning a new page to the browser?"
http://www.htmlhelp.org/faq/cgifaq.3.html#14

FAQs are good for you.  Take one frequently, not only when the
symptoms recur ;-)

> 2. On Macintosh using Internet Explorer, when you use the file upload
> form element, the file that is sent up to the server has all of this
> additional information at the beginning and end. 

You'll get better results when you start to divide your problems up
and understand what parts are relevant to what, so that you can
research the answer in the appropriate place(s).  There didn't seem to
be a single Perl language issue in your posting, and I suspect that
relatively few people here are familiar with the details of Macs,
unlike people on, say, comp.infosystems.www.browsers.mac.

> Thanks!!

I don't suppose you'll welcome this answer, but that's the way it goes
on usenet.  Good luck with your search, anyhow.



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

Date: Tue, 30 May 2000 10:05:17 +0200
From: "Robert Voesten" <robert@pharmapartners.nl>
Subject: Extracting info from variable
Message-Id: <8gvsnv$79c$1@porthos.nl.uu.net>


Hi all,

How do extract info from this variable in a file:
"DTM07137199810121215203                    "
(so it is DTM07137199810121215203 + 20 spaces"

the info output must be:

"Date of creation: 12th octobre 1998 at 12:15"

since the parameters are set up like this:

DTM07137 = Date of creation
199810121215 = CCYYMMDDHHMM (date/time)
203= just an ending paramater
the 20 spaces are needed to complete the "date/time" parameter
for the total value of signs must be 35.

can you pleas help me out.

I first tried it my own offcourese, and the result was this (which didn't
work. because of the logical errors):

open (FILE, "file.txt");    #check all lines 1 by 1
for
        FILE

if (/DTM[0-9]{5}([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})[0-9]{3}
{20}/)    {
        # DTM 12345   (1998)      (10)           (12)          (12)
(15)           203    spaties
        print "Aanmaak datum: $3-$2-$1 om $4:$5";
    } else {
        print "Error, doesn't work";
    }
}
close FILE;


--

Robert Voesten
Pharmapartners BV





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

Date: Tue, 30 May 2000 08:19:33 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Extracting info from variable
Message-Id: <MPG.139e16b4ffb6430e9896f5@news>

Robert Voesten writes ..
>How do extract info from this variable in a file:
>"DTM07137199810121215203                    "
>(so it is DTM07137199810121215203 + 20 spaces"
>
>the info output must be:
>
>"Date of creation: 12th octobre 1998 at 12:15"
-
>I first tried it my own offcourese, and the result was this (which didn't
>work. because of the logical errors):
>
>open (FILE, "file.txt");    #check all lines 1 by 1
>for
>        FILE
>
>if (/DTM[0-9]{5}([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})[0-9]{3}
>{20}/)    {
>        # DTM 12345   (1998)      (10)           (12)          (12)
>(15)           203    spaties
>        print "Aanmaak datum: $3-$2-$1 om $4:$5";
>    } else {
>        print "Error, doesn't work";
>    }
>}
>close FILE;

you basically did it .. I'm sure others will point out some stylistic 
improvements in your code .. but basically all you need to do is 
structure the 'for' statement correctly to read from a file handle

instead of

  for
          FILE

you should have

  for(<FILE>)
  {

and that's all .. your code works (assuming that it was posting it here 
that broke your comment and regex lines apart)

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Tue, 30 May 2000 12:53:06 +0200
From: Olivier laurent <olivier.laurent@archangelis.com>
Subject: help newbie : how to count line into a txt file
Message-Id: <39339D92.A9379252@archangelis.com>

Hi,

I usually work with javascript/HTML (I'm a webdesigner) and I don't know
nothing at all about perl.

I've got to make a script that count the number of lines of a txt file.
and publish the result into a static HTML page.

Is there anybody who can tell me how to start ?

Any examples will be warmly welcome.

thx

Olivier




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

Date: 30 May 2000 09:54:53 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: How Sambar 4.2 run CGI ?
Message-Id: <8h035d$tfe$0@216.155.32.164>

In article <8gmejn$mv9$1@news.seed.net.tw>, "Adolf" 
<adolftw@tcts1.seed.net.tw> wrote:

 | I do not have network card and open ''http://localhost/'' in IE4
 | The ''index.htm'' is OK
 | but when I link to <a pref=''/cgi-bin/main.cgi''>Click me.</a>
 | IE4 showed ''The object requested could not be found on the server.
 | ......''

<a href=

not

<a pref=

HTH

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Tue, 30 May 2000 10:17:34 +0300
From: "Alexey Alexapolsky" <wake@thukraine.com>
Subject: how to redirect input
Message-Id: <8gvq8j$kfi$1@ark.cris.net>

Hi helper :-) a SIMPLE QUESTION AGAIN -
HOW TO REDIRECT INPUT IN PERL - FOR EXAMPLE I
NEED A LINE " if (/findstring/)   {print $_ ;}"  work not with usual stdin ,
but stdin from a particular file.
Thanx in advance.
PS Is this question to unbearably simple for this newsgroup?




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

Date: 30 May 2000 07:42:10 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: how to redirect input
Message-Id: <8gvrci$2ob$1@newsflash.concordia.ca>

In article <8gvq8j$kfi$1@ark.cris.net>,
Alexey Alexapolsky <wake@thukraine.com> wrote:
>Hi helper :-) a SIMPLE QUESTION AGAIN -
>HOW TO REDIRECT INPUT IN PERL - FOR EXAMPLE I

OK. PLEASE STOP SHOUTING. (Don't type in all caps.)

>NEED A LINE " if (/findstring/)   {print $_ ;}"  work not with usual stdin ,
>but stdin from a particular file.

/findstring/ doesn't read from STDIN anyway. It would check $_, which
is far from the same thing.

I suggest you check out the documentation on open (perldoc -tf open),
and possibly perldoc perlopentut.

open FILE, "< myfile.txt" or die $!;
while (<FILE>) {
    print if /findstring/;
}
close FILE;


-- 
Neil Kandalgaonkar
neil@brevity.org


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

Date: 30 May 2000 12:37:27 +0100
From: nobull@mail.com
Subject: Re: how to set the filename when sending content of unknown type to a browser?
Message-Id: <u9og5o5kw8.fsf@wcl-l.bham.ac.uk>

mvdbos@integral.nl (M. van den Bos) writes:

> I don't even know if this is the right group to ask this question in,
> but I hope you can help me.

I think the general concensus is no.  This question is really an HTTP
question or just maybe a CGI question.  If you are interested I
suggest you go to deja and look at the debate that rages each time
this question is asked.  It's asked every week or so so you shouldn't
have to go back too far.

> I have this perl script I'm working on that sends a delimited file to
> a browser with "content-type: unknown" so that the user gets to save
> the file.

In doing the above research you'll also find that this is not reliable.

> So far this all works fine, but the default filename in the dialog is
> the name of the script which sends the output. Is there any way of
> setting that filename to something else?

Yes but rather than re-ignite the same old flame-war that always
follows anyone answering this question I recommend you go back an look
at previous answers.

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


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

Date: Tue, 30 May 2000 10:02:21 GMT
From: irpag@gmx.net
Subject: Image::Magick installation error, please help
Message-Id: <8h03j7$v3p$1@nnrp1.deja.com>

Hello!

I use activestate Perl version
This is perl, v5.6.0 built for MSWin32-x86-multi-threa
(with 1 registered patch, see perl -V for more detail)

and downloaded the ImageMagick module from
http://www.ActiveState.com/packages/zips/

But if I try to install it via ppm I get the following error message:
F:\TEMP>ppm install Image-Magick.ppd
 Error installing package 'Image-Magick.ppd': Could not locate a PPM
binary of 'Image-Magick.ppd' for this platform

Please can someone help me to solve the problem, because I need this
module for my thumpnail script

thank you very much
  Reinhard Pagitsch

P.S: Please send a copy to my E-Mail adress
Thank you again

http://members.eunet.at/irpag/
http://www.hotll.webprovider.com/


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Tue, 30 May 2000 04:46:56 -0700
From: Garbage <peterhardingNOpeSPAM@yahoo.com.invalid>
Subject: Is Perl for me?
Message-Id: <041afcc0.08aae64c@usw-ex0102-013.remarq.com>

This maybe isn't the right forum for this type of question, BUT:

I am a UNIX administrator who would like to increase my skill
set. I am NOT a programmer, but would like to learn a new skill
that will put me in good shape for the future:-

1. Is Perl going places?
2. Is it old hat technology?
3. Is it in great demand by ISP's?

Thanks for any guidance on this.

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Tue, 30 May 2000 14:07:55 +0200
From: Andreas =?iso-8859-1?Q?V=F6rg?= <a.voerg@ieee.org>
Subject: modify the environment variables permanently via Perl
Message-Id: <3933AF18.336A1E0B@ieee.org>

Hello,

I am looking for a way to modify the environment variables permanently
via Perl. I tried system(...); and $ENV{...}, but after runtime of the
script, my modifications
are gone.
The problem seems to be, that Perl opens a own shell in the background
with system() and closes it after the command is executed.
Also a hint, where to find information about what exactly happens when
executing system(), will help. I already read the FAQ and manpages but
did not find
something useful.

Thanks

Andreas Vörg
EMail: mailto:a.voerg@ieee.org



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

Date: Tue, 30 May 2000 14:44:51 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: modify the environment variables permanently via Perl
Message-Id: <3933B7C2.263FB54B@nospam.com>

Andreas,

Andreas V=F6rg wrote:
> I am looking for a way to modify the environment variables =

> permanently via Perl. I tried system(...); and $ENV{...}, but =

> after runtime of the script, my modifications are gone.

  Since PERL runs as a child process of the shell you have used to
launch it, this is reasonable:  Generally--but I suspect it is a system
dependent matter--a child process inherits a copy of the environment
that is destroyed at its end.  I suspect too that if you want to make
that change permanent, you have to work on your shell configuration file
directly.


	Best regards,
		Marco


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

Date: 30 May 2000 08:08:28 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: my $x vs. my ($x)
Message-Id: <8gvsts$juh$0@216.155.32.164>

In article <m1n1ldff5w.fsf@halfdome.holdit.com>, merlyn@stonehenge.com 
(Randal L. Schwartz) wrote:

 | >>>>> "Tim" == Tim  <tcuffel@exactis.com> writes:
 | 
 | Tim> However, I have seen my ($x) in posted code, some of the books, and 
 | other
 | Tim> semi-respectable sources.  Is there any kind of concensus on which 
 | is more
 | Tim> appropriate?
 | 
 | Depends on what you want:
 | 
 |         my  $x  = @_; # number of elements passed to this subroutine
 |         my ($x) = @_; # first element
 | 
 | So, it's not a matter of which is "right", but which is "right for the
 | use".  You gotta know about both.


there's also an instance where you may want to pre-declare certain 
variables all at once, and it's easier to type 

my ($var1, $test, $something, $someotherthing);

than to use

my $var1;
my $test;
my $something;
my $someotherthing;

and looks cleaner.

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Tue, 30 May 2000 08:40:18 +0100
From: Richard Hardicre <rhardicr@ford.com>
Subject: Re: newbie question - dbi:mysql
Message-Id: <39337062.BA59C2E8@ford.com>

The WebDragon wrote:
> 
> aside from the fact that you knew the error code was '0E0', how would
> one discover this obscure code .. reading the pod manual in DBI::MYSQL ?

You'd read the DBI documentation for 'execute', that's where i got it
from, not out of the ether...

Richard H


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

Date: 30 May 2000 07:17:05 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: Newbie: Pattern Match Question
Message-Id: <8gvpth$au9$1@newsflash.concordia.ca>

In article <39332A7C.6847662D@stomp.stomp.tokyo>,
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:

>if (($line =~ /2000/) & ($line =~ /\.html/))
>

Caution: "&" does not mean "logical and" in perl. It is a completely 
different operator which just happens to give the same results in this
particular case.

For instance:   

     if (1 & 1) { print "yes" } else { print "no" }    # yes

     if (2 & 1) { print "yes" } else { print "no" }    # no

What you really want is:

     if (($line =~ /2000/) && ($line =~ /\.html/))

or, to dispense with some parentheses:

     if ($line =~ /2000/ and $line =~ /\.html/)

(Actually, in this case, the inner sets of parentheses are unnecessary
for both "&&" and "and", but it safer to try such tricks with "and").

See the 'perlop' page of perl's documentation for further explanation. 

The difference between "&" and "&&" has been pointed out to this 
particular poster on numerous occasions. This poster is a known troll.
Usenet wisdom suggests the best policy is to ignore her except to 
correct factual errors.  

-- 
Neil Kandalgaonkar
neil@brevity.org


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

Date: Tue, 30 May 2000 12:40:10 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: No Flash
Message-Id: <slrn8j7dpp.6m1.tjla@thislove.dyndns.org>

I was shocked! How could sang <laoxiu100@hotmail.com>
say such a terrible thing:
>Hi,alls
>
>I am developing a chat room code.
>I use client pull to refresh chat html. 
>But i don't like the flash, is there any 
>way to avoid flash of chat html?

Probably there is. What exactly is your Perl question?

-- 
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
My words are like stone; baked and cooked to stand the test of time. Yet, my
words will be forgotten like the sands under the sea.
		-- Robert Eckman


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

Date: 30 May 2000 12:52:45 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: oops Re: seeking method to encode email addresses in web page forms
Message-Id: <8h0dit$dkh$0@216.155.32.164>

In article <392EB09E.B018AB1F@stomp.stomp.tokyo>, "Godzilla!" 
<godzilla@stomp.stomp.tokyo> wrote:

 | The WebDragon wrote:
 |  
 | > Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
 |  
 | >  | $email = "callgirl\@la.znet.com";
 |  
 | > DOH, forgot one thing too.. you can leave off escaping
 | > the @ if you use
 |  
 | >     $email = 'callgirl@la.znet.com';
 | 
 | However, I am not using apostrophes for quotes.
 | This @ character needs to be escaped or a syntax
 | error is encountered.
 | 
 | Would you mind citing a rule indicating I must
 | use apostophes for quote marks? Seems a matter
 | of personal preference, when syntax variations
 | are used correctly.

no, actually there is a difference.. 

with "" pairs, what is between them gets interpolated, (meaning you have 
to escape the @)

with '' pairs, there is no interpolation, meaning it is not necessary to 
use \@ 

see the difference? :)

I know you didn't originally use the ' marks, however I thought you 
might like to know about it, as for long strings, there is no need to 
escape chars within, no variable or metachar interpolation occurs, and 
you don't have to escape other \" marks that may appear inside the '' 
pairs :)

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: 30 May 2000 01:19:35 -0700
From: Sue Spence <sue@pennine.com>
Subject: Re: Perl forking question (multiple times)
Message-Id: <8gvtin$2as@drn.newsguy.com>

In article <39332596.C60A305D@nwu.edu>, Juan says...
>
>Hello, 
>
>Right now my program is forking once, so that it runs 2 processes at the
>same time. I was wondering if I could then have those two processes fork
>themselves so that then there are 4 processes running (2^2) ? Is this
>possible? 

Yep.  But if you fill up your process table with an out of control fork routine,
don't come crying to us.  ;-)

>If so, is it wise, would it be too much server load for one
>task? 

Dunno, depends on your server and what you're doing.

>
>Also, I am calling $SIG{CHLD} = 'IGNORE'; 
>at the top of my scipt as well as right before I fork. It's all
>inherited right, so I don't have to call it again when I fork a second
>time (within the first fork), right? 

Should do.  See man fork.



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

Date: 29 May 2000 15:54:27 -0800
From: yf110@victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Perl unusable as a programming language
Message-Id: <3932f523@news.victoria.tc.ca>

Tushar Samant (Tbone@pimpdaddy.com) wrote:
: The scary parts, actually, are the semantics... e.g. 

: f($1), which has no relation to $1 at function call time.


Could you explain this comment please.  I don't understand what the
issue would be with "f($1)"


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

Date: 30 May 2000 01:07:41 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: Perl unusable as a programming language
Message-Id: <slrn8j652t.u94.simon@justanother.perlhacker.org>

Tushar Samant (comp.lang.perl.moderated):
>But there are many versions. And although the powers that be are
>mostly kind enough to make only syntax errors do something cool in
>a new version, there is no saying how undocumented things will change.

Speaking as a relatively minor power that is - what undocumented things?
Perl doesn't have them. If things are undocumented it's because the
documenters haven't found them yet. Or that we have found them, and they
were too ugly to easily comprehend and be useful. So if you start
programming "outside the box" why do you feel you should be protected?

You're not protected in any other language, because even fully specified
languages have "undocumented" components. C has rather a lot of nasal
demons; Perl tries to keep them to a minimum. But they both have the
same effect if you wake them.

>BTW, I am curious how a feature is chosen for deprecation. Can it be
>any way other than (possibly unfounded) guesses about how infrequently
>used it is?

Yes, quite definitely. If it's a bad idea, and has been superceded by a
better idea, and (for bonus points) was initially marked experimental,
then it will be marked as deprecated. You'll typically get a warning
about the better way to do it for quite a few years before it actually
breaks. I haven't seen a "flag day" in Perl yet without a huge amount of
warning, and I'm confident I never will.

>the latter case, and starts with a yes/no question about a *general*
                                                            ^^^^^^^^^
>behaviour: e.g. does Perl do sequential evaluation in such-and-such
                                                       ^^^^^^^^^^^^^
>a case. 
 ^^^^^^^

Something appears inconsistent here. I'm going to accuse you of
over-philosophising a purely practical matter.

> If it's true, no experimentation is going to prove it.

I apparently have a lot to learn about the scientific method.

See, if you have "such-and-such a case" and you want to know how Perl,
physics, or anything else in the world, treats it, I always thought that
you can experiment with it and examine the results.

Apologies if I've misunderstood your argument, but here's how it looks
to me:
    I have $a = 1
    I want to know what Perl will do in the case that I say $a++
    I expect Perl to tell me that $a is now 2
    I can prove this by saying: perl -le '$a=1; $a++; print $a;'
    Indeed, it prints 2.
    Not only are you appearing to tell me that I can't prove that $a++
    increments a variable by 1, (no experimentation on a specific case
    can prove a generalism) but you're also trying to tell me that I
    can't prove that $a++ when $a=1 will always produce $a = 2. (no
    experimentation on "such-and-such a case" is going to prove it)

This seems slightly contrary.
-- 
It's a short step from using alt.binaries.warez.protocol-droids.c3p0 to
Palpatine seeing a post along the lines of: "CA|\| NE1 0N Th]5 BB0ARD T3Ll M3
H0w 2 GeT KeWL S]Th P0WeRZ!?!?!?!??!?"  The rest is, well, a couple
more overly-hyped ILM graphics demos.  -- henke@kharendaen.krall.org in ASR


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

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 V9 Issue 3203
**************************************


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