[11294] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4894 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 15 00:07:27 1999

Date: Sun, 14 Feb 99 21:00:29 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 14 Feb 1999     Volume: 8 Number: 4894

Today's topics:
        A very simple problem (Ogden Freen)
    Re: ActivePerl on Win95 (Joseph Java)
        Can 2 "submit" buttons in 1 form do different things? <vikette@earthlink.net>
    Re: Comments in Perl code <palincsars.isc@gao.gov>
        converting to DBF format (Bababozorg)
    Re: database: viewing large result sets in perl? (Tad McClellan)
    Re: Datetime manipulation in perl sharda@hotmail.com
        Editor <dpg@ez-poa.com.br>
    Re: File creation problem !!Someone has to know this!! (Martien Verbruggen)
        getting full path of program name <xah@best.com>
    Re: getting full path of program name <gwynne@utkux.utk.edu>
    Re: how do I get a date in perl? (Larry Rosler)
        How do I open & size a popup browser window? <vikette@earthlink.net>
    Re: How do I parse carriage returns, not newlines (Jim Griffin)
        HOW pass input to perlscript ? <philip.class@popcorn-studio.ch>
    Re: HOW pass input to perlscript ? <thelma@alpha2.csd.uwm.edu>
    Re: HOW pass input to perlscript ? <gwynne@utkux.utk.edu>
    Re: Newbie question <southpark@nni.com>
    Re: Newbie question <mpersico@erols.com>
        package reference??? <n8twatch@usa.net>
        PAM conversation script? (william cunningham)
        problem with Hash refs in s/// <tapio@vtoy.fi>
        script to forward email lovena@netway.com
    Re: Simple question of the beginner. <palincsars.isc@gao.gov>
    Re: Simple question of the beginner. (Andre L.)
    Re: String splitting. <palincsars.isc@gao.gov>
        V-day Perl Poetry <southpark@nni.com>
    Re: V-day Perl Poetry (brian d foy)
    Re: Windoze Dial up networking with PERL (Joseph Java)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 14 Feb 1999 23:27:49 GMT
From: Oggy_F@don't_spam_me.yahoo.com (Ogden Freen)
Subject: A very simple problem
Message-Id: <36c75b28.4296427@news.comcen.com.au>

I admit it... I'm a complete newbie. I really need some help.
I'm trying to make a web counter that ticks over whenever a specific
link is clicked, and then gets the URL.
Can anyone help?


_____________________________________________________
www.freen.to


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

Date: Mon, 15 Feb 1999 03:58:37 GMT
From: beenz@nycap.rr.com (Joseph Java)
Subject: Re: ActivePerl on Win95
Message-Id: <36c79951.11248922@news.nycap.rr.com>

On Wed, 03 Feb 1999 17:03:14 GMT, bart.lateur@skynet.be (Bart Lateur)
wrote:

>Juho Cederstrvm wrote:
>
>>>$dummy = <STDIN>;
>>>Then you just have to hit enter when you want the DOS box to disappear.
>>
>>I usually put just
>>
>><>
>>
>>and that's fine also.
>
>Except, if your program dies because of a die statement when the input
>is not yet empty, it will simply go ahead and close the window.
>
>I do a 
>
> END {
>	<STDIN>
> }
>
>which works, but it's also silly.
>
>Oi! Guys from Activestate, or other knowledgable persons! Is there a
>way to set a preference that .PL files when not run from the web server
>(how would it know? Not sure...) that the window stays open? There
>*must* be a way...
>
>	Bart.

I would try... writing a c program (or assembler if you feel lucky)
that is named "p.exe". This program will do almost nothing except, in
turn, run "perl.exe" and pass it the paramters it recieves. But it
gives you a little control over it. You can add any logic or decisions
you want in this tiny little "p.exe". 
You simply associate ".pl" with "p.exe" instead of "perl.exe".

To keep the OS from closing the window, "p.exe" can wait for input as
described above. I would print out a line telling the user to push a
key to close window. This would work even if the perl program exited
early on a "die" command.
The part I don't know is how you can tell whether a web server has
called "p.exe" or if some other process called it. Perhaps you could
add a command line argument to tell p.exe to keep the window open when
you are running it from the keyboard/desktop. This command argumant
would be filtered and not passed to perl.exe. By default you could
have it close the window on exit. 

-JJ



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

Date: Sun, 14 Feb 1999 20:27:52 -0800
From: "Pamela Schultz" <vikette@earthlink.net>
Subject: Can 2 "submit" buttons in 1 form do different things?
Message-Id: <7a87ng$6vk$1@holly.prod.itd.earthlink.net>

I have a polling script being executed as a result of a form submit. See
http://www.lineoffire.com/vote.html. Right now my "vote" button is in 1 form
and my "view results" button is in another form -- therefore they are on
separate lines in my html page since I can't put 2 forms on the same line.
My perl script looks for values in hidden fields in order to determine what
to do. Like this:

if ($fields{'action'} eq "VIEW")
    {
      &do_stuff;
      exit;
    }

   if ($fields{'action'} eq "VOTE")
    {
    &do_other_stuff;
      exit;

In this example "VIEW" and "VOTE" are values for the hidden "action" field
in each form. What I'd like to do is have my 2 buttons side by side in the
same form instead of one on top of the other. Is there a way to do this? I'm
new to perl and cgi, so I'm not sure what gets passed to the perl script.
Can I have 2 submit buttons in the same form that do different stuff? Can I
somehow pass to the perl script which button is pressed by the user? Thanks
for your help!

Pam
vikette@yahoo.com






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

Date: Sun, 14 Feb 1999 20:48:20 -0800
From: Stephen F Palincsar <palincsars.isc@gao.gov>
Subject: Re: Comments in Perl code
Message-Id: <36C7A714.61D1@gao.gov>

I'm using gnu emacs, latest versioin and the latest version of
cperl-mode.el.  I've encountered the peculiarities of font-lock-mode
with here documents, and have found that generally the best way to
correct miscoloration is to enter alt-x normal mode.  Not sure just
why this works, but it is mentioned in the mini-docs.

Steve Palincsar


Matthew O. Persico wrote:
> 
> Russ Allbery wrote:
> >
> > Matthew O Persico <mpersico@erols.com> writes:
> >
> > > I'm using cperl-mode 4.19 and I almost cannot break it. Lord knows I've
> > > tried. But every time I think it's messed up the indenting or font
> > > coloring it has turned out to be a typo or a construct that didn't make
> > > it through perl -c.
> >
> > > Except for one tiny thing that drives me nuts.
> >
> > > Pod.
> >
> > > No let me rephrase that.
> >
> > > Possessives in pod. As in:
> >
> > >       this function's arguments.
> >
> > > cperl 4.19 reads that as a string start and I get all green text until
> > > the next random possessive in my pod.
> >
> > What version of emacs are you using?  I think this is one of the things
> > that supposed to be fixed by the improved character scanning support in
> > 20.3 (I have the same problem, and even more annoyingly have it with
> > possessives in heredocs, which make cperl-mode think everything after that
> > is still in a string, but that's because I'm still using an unpatched
> > 19.34 because I don't want to apply patches to it and because I utterly
> > detest MULE).

Apropos of MULE, isn't this something that if you ignore it and do not
even look at the menu, it doesn't bother you?


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

Date: 14 Feb 1999 23:10:43 GMT
From: bababozorg@aol.com (Bababozorg)
Subject: converting to DBF format
Message-Id: <19990214181043.22088.00001708@ng09.aol.com>

hi
i want to convart my database which is comma sperated in a txt file, to a dbf
format by perl i dont know how to do it.
can anyone help please
thanks
hamed


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

Date: Sun, 14 Feb 1999 17:35:52 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: database: viewing large result sets in perl?
Message-Id: <okm7a7.509.ln@magna.metronet.com>

Matt Arnold (marnold@novia.net) wrote:
: SYNOPSIS: { There are numerous posts and web pages dedicated to the topic of
: querying databases from perl.  But all these articles assume that our perl
: program is well-equipped to deal with result sets of infinite size.  So how
                                                       ^^^^^^^^^^^^^
: can our perl programs elegantly deal with these large result sets? }
                                                  ^^^^^


   Which is it?

   Infinite or merely large?

   Rather uhh, large difference between those two...


   Can you really _get_ an infinite size set of anything?

   I will be quite astounded if you can...


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Mon, 15 Feb 1999 00:07:10 GMT
From: sharda@hotmail.com
Subject: Re: Datetime manipulation in perl
Message-Id: <7a7ofb$93c$1@nnrp1.dejanews.com>

I appreciate your help.

If I knew the position of each of the fields(i.e month,day and year), then it
would have been a very easy thing to do.

The problem is that there is no fixed sequence/order of these fields. Month or
Day or Year could come first or in any combination.

Whatever the order is, while storing in the database, I am trying to store it
as mm/dd/yyyy pattern, ofcourse after finding out which fields are month, day
and year(and this is the most difficult task at present).

Any suggestions?

Reg.,
Sharda

In article <36C6C2B9.BEA7B158@hadiko.de>,
  Hajo Pflueger <Hajo@hadiko.de> wrote:
> Hi,
>
> >    Hence a data could be: 08 2 03 12:12:12
>
> what about
> $month = (split(/ /,$data))[0]
> ?
>
> It seems to be that the month is the first "word" in the data-string. So
> just take the first word and work with ist. If you want to have a result
> like 08->August, Aug->August and 8->August, try:
>
> $mnames{'8'} = 'August';
> $mnames{'Aug'} = 'August';
> ...
> if ($month =~ /^0/) { $month = substr($month,1); } # kill the leading
> zero
> $mname = $mnames{$month};
> print $mname;
>
> Cheatah
>
> --
> I am a signature-virus. Why don't copy me into your sig?
>
> Come to Cheatah's World at http://cheatah.net/
> The World of Linkrotations, Fun and more!
> Get your OWN FREE Linkrotation!
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 15 Feb 1999 02:53:18 -0300
From: "Douglas Piccinini Gerhardt" <dpg@ez-poa.com.br>
Subject: Editor
Message-Id: <36c7a71c.0@irc.ez-poa.com.br>

Where I can get the Programer's Editor??

Thanks

Doug




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

Date: Mon, 15 Feb 1999 00:09:13 GMT
From: mgjv@timber.comdyn.com.au (Martien Verbruggen)
Subject: Re: File creation problem !!Someone has to know this!!
Message-Id: <JAJx2.2366$Uh.22706@nswpull.telstra.net>

On Mon, 15 Feb 1999 09:56:57 +1100, 
	Patrick Fong <patfong@yoyo.cc.monash.edu.au> wrote:
>My problem is that I want to create a file and write data to it using
>Perl. Or any other languages.

# perldoc -f open

>The file name is supplied by the client in the Web browser and the data is
>written to it upon form submission. 

Ah, a CGI thingie.

# perldoc CGI

That module comes with many handies for this sort of thing.

>1)  $filename = "$FORM{'filename'}".".txt";
>    open (RECORD, "+>filename");
>    print RECORD "...form data...";

Why don't you check the return value of the open?

# perldoc -f open

Do you really want read AND write access? Just write would be
sufficient here.

Are you sure you want to open the literal 'filename'? Or did you mean
$filename?

open(RECORD, ">$filename") || die "Cannot open $filename for write: $!";

>My problem is that the file isnt created. So I dont really think that Perl
>can create a file? So am I right?? Is there any other languages that

Of course perl can create a file. Did you bother to read the
documentation?

>This problem has been bothering me for ages!!!

And if you had read the documentation, it wouldn't have. Please, for
your own sake, learn to use the perldo command, or use the html that
comes with the Activestate perl, or buy a good book.

[snip of enormous signature]

And please, shorten your signature. Normal rules for signatures are:

start with "-- " on a line. (without quotes)
limit signature to four lines.

Martien



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

Date: Sun, 14 Feb 1999 18:28:40 -0800
From: "Xah" <xah@best.com>
Subject: getting full path of program name
Message-Id: <36c78659$0$205@nntp1.ba.best.com>

What is a reliable and portable way of getting the absolute path of the 
running script?

Obviously, qw{pwd}, File::Basename, $0 are not solutions...

(I was thinking that $0 should do it. Perhaps this makes a good feature
request?)

Thanks.

 Xah
 xah@best.com
 http://www.best.com/~xah/PageTwo_dir/more.html
 "Homer Simpson = your local unix weenie."


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

Date: Sun, 14 Feb 1999 23:25:20 -0500
From: "Robert Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: getting full path of program name
Message-Id: <7a885p$mrl$1@gaia.ns.utk.edu>

$path = `pwd`;

Bob
---------------------------
Bob Gwynne
gwynne@utkux.utk.edu
Speech Comm
University of Tennessee, Knoxville

JAPN (Just Another Perl Newbie)


Xah <xah@best.com> wrote in message news:36c78659$0$205@nntp1.ba.best.com...
>What is a reliable and portable way of getting the absolute path of the
>running script?
>
>Obviously, qw{pwd}, File::Basename, $0 are not solutions...
>
>(I was thinking that $0 should do it. Perhaps this makes a good feature
>request?)
>
>Thanks.
>
> Xah
> xah@best.com
> http://www.best.com/~xah/PageTwo_dir/more.html
> "Homer Simpson = your local unix weenie."




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

Date: Sun, 14 Feb 1999 18:49:26 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: how do I get a date in perl?
Message-Id: <MPG.11312b0c3f1e9471989a3c@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <36c72560@news1.us.ibm.net> on Sun, 14 Feb 1999 13:33:09 -
0600, Walter Torres <tavi@earthling.net> says...
> I have a very small Perl file that I created to do simple Date and Time
> functions.
> 
> Nothing like Date:Manip, but a lot smaller.

Good.  Several of us are posting similar functions, to be placed in the 
new Perl Function Repository.

> If you are interested in it, drop to my web site and take it.
> 
> www.tscinternet.com/perl
> 
> You need to use this exact address, just dropping inot the main page will
> get you nowhere.

Actually, this exact address gets you nowhere also, because the 
directory is empty.

> Walter
> 
> PS: The only problem I have with this file is TimeZone info on Win32 and
> Mac.

Just this very day, I posted a function tz_offset() to solve this very 
problem in an OS-independent way (without reading $ENV{TZ})!

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Sun, 14 Feb 1999 19:56:22 -0800
From: "Pamela Schultz" <vikette@earthlink.net>
Subject: How do I open & size a popup browser window?
Message-Id: <7a85se$3lr$1@holly.prod.itd.earthlink.net>

Hi, I'm implementing a perl cgi "voting" script that asks users a question
then tallies & displays results. The current look of the script is at
http://www.lineoffire.com/vote.html. Currently the script replaces the
voting page with the results page. However, I'd like the script to open a
2nd browser window that is sized much smaller (say 300 height  X 500 width).
How do I specify properties of the browser window in perl? I know it can be
done in javascript. This is my first attempt at a perl script. Thanks for
any help!

Pam
vikette@yahoo.com





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

Date: Mon, 15 Feb 1999 00:11:12 GMT
From: jgriffin@netcom.com (Jim Griffin)
Subject: Re: How do I parse carriage returns, not newlines
Message-Id: <jgriffinF765uo.GGE@netcom.com>


Why not just look for \cM and replace it w/ something like
s/\cM//

aretol@my-dejanews.com said:
: Hi all,

: I am trying to parse a flat file that contains both newlines and carriage
: returns (^M). For some reason, my program won't pick up any matches
: dealing with carriage returns. I use the \r character, but it doesn't
: seem to work. It seems to pick up \n just fine however.

: Here is the gist of my code:

: open(F,$ARGV[0]);

: while (<F>)
: {
:    if (m/\r/) {
:       print;
:    }
: }

: close(F);

: Any help would be appreciated. Thanks.

: Dan

: -----------== Posted via Deja News, The Discussion Network ==----------
: http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    
-- 
                                             jgriffin@netcom.com
                       http://members.tripod.com/~trunculo/index


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

Date: Mon, 15 Feb 1999 01:13:34 +0100
From: "Philip Class" <philip.class@popcorn-studio.ch>
Subject: HOW pass input to perlscript ?
Message-Id: <7a7oqf$80p$1@bw107zhb.bluewin.ch>

I need to pass an input-string to a perlscript (sounds very easy...but I
simply can't find the fitting argument)
The perl script needs an Inputfile and an Outputfile that need to be entered
together with the interpretor & script.
e.g.  :

Perl Scriptname MyInputfile MyOutputfile
The script should be able to use the values MyInputfile and MyOutputfile.

My someone please give me a hint or the correct syntax ?

Thanks a lot,

Philip

PS: Looking for Perl Code Help and tutorial / manuals I get very much the
impression that Perl is the less user friendly programming language. To fix
Perlscript-Bugs I loose/spend more time that with any other programming
language.
Does someone share my view ?




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

Date: 15 Feb 1999 02:56:33 GMT
From: Thelma Lubkin <thelma@alpha2.csd.uwm.edu>
Subject: Re: HOW pass input to perlscript ?
Message-Id: <7a82d1$75f$1@uwm.edu>

Philip Class <philip.class@popcorn-studio.ch> wrote:
: I need to pass an input-string to a perlscript (sounds very easy...but I

: Perl Scriptname MyInputfile MyOutputfile

: The script should be able to use the values MyInputfile and MyOutputfile.

       ## set up variables to hold the input, output filenames:
           $inputfile  = $ARGV[0];
           $outputfile = $ARGV[1];

       ## and invoke the script exactly as you've written above.

: My someone please give me a hint or the correct syntax ?

: Thanks a lot,

: Philip

: PS: Looking for Perl Code Help and tutorial / manuals I get very much the
: impression that Perl is the less user friendly programming language. To fix
: Perlscript-Bugs I loose/spend more time that with any other programming
: language.
: Does someone share my view ?

             I don't -- it's the easiest language I've worked with,
             but then I came to it in the midst of struggling with
             C++ [and I'm still struggling with that]
             Perhaps you haven't yet found all the documentation that
             comes with most implementations...
                               --thelma


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

Date: Sun, 14 Feb 1999 23:17:05 -0500
From: "Robert Gwynne" <gwynne@utkux.utk.edu>
Subject: Re: HOW pass input to perlscript ?
Message-Id: <7a87mb$mj0$1@gaia.ns.utk.edu>

Get a copy of Perl 5 Interactive Course by Jon Orwant or Learning Perl by
Randal Schwartz & Tom Christiansen.  Work your way through one or both.
There is also a lot of documentation available on the Web and as part of the
distribution.  If you want to read a comparison of Perl with VBScript, see
http://www.microsoft.com/sitebuilder/magazine/clinick_perl.asp

I would give you the hint that you ask for; however, you need more knowledge
before you proceed.

Bob
---------------------------
Bob Gwynne
gwynne@utkux.utk.edu
Speech Comm
University of Tennessee, Knoxville

JAPN (Just Another Perl Newbie)



Philip Class <philip.class@popcorn-studio.ch> wrote in message
news:7a7oqf$80p$1@bw107zhb.bluewin.ch...
>I need to pass an input-string to a perlscript (sounds very easy...but I
>simply can't find the fitting argument)
>The perl script needs an Inputfile and an Outputfile that need to be
entered
>together with the interpretor & script.
>e.g.  :
>
>Perl Scriptname MyInputfile MyOutputfile
>The script should be able to use the values MyInputfile and MyOutputfile.
>
>My someone please give me a hint or the correct syntax ?
>
>Thanks a lot,
>
>Philip
>
>PS: Looking for Perl Code Help and tutorial / manuals I get very much the
>impression that Perl is the less user friendly programming language. To fix
>Perlscript-Bugs I loose/spend more time that with any other programming
>language.
>Does someone share my view ?
>
>




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

Date: Sun, 14 Feb 1999 12:13:50 -0500
From: Eric Windisch <southpark@nni.com>
Subject: Re: Newbie question
Message-Id: <36C7044E.BC766158@nni.com>

The perl from Redhat 5.2 is broken, upgrade.  This might not help, but
it is a known fact that the Perl packaged with 5.2 has some problems.

-Eric Windisch


seong joon bae wrote:
> 
> Hello,
> I just started learning perl on my own.
> I was writing a simple program that counts number of lines, words and
> characters from a given file.
> This code is from the book,
> 
> while (<INFILE>)
> {
>     $TheLine = $_;
>     chomp($TheLine);
>     $Linecount = $Linecount + 1;
>     $LineLen = length($TheLine);
>     $Charcount = $Charcount + $LineLen;
> ....
> ...
> ...
> }
> 
> but this program gets stuck at
> $TheLine =$_;
> From the book, that line is supposed to save the line's contents.
> I guess my perl doesn't recognize $_ thing.
> Does anyone have any suggestion for me?
> do i need to upgrade my perl?
> I'm using the one that came with Redhat5.2.
> thank you.


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

Date: Sun, 14 Feb 1999 20:48:17 -0500
From: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: Newbie question
Message-Id: <36C77CE1.28982351@erols.com>

Advice for you:

1) 'newbie question' is a total non-helpful subject. There are many
people who read many newsgroups with many posts and there's a good
chance that a subject like this will be ignored by a great many people
who could answer you.

Maybe yuo feel like you're apoligizing in advance. Don't. Just state the
problem, as in "$_ doesn't work reading a file."

2) What is INFILE? If it is a filehandle, show us the open statement. Do
you check it for errors? 

seong joon bae wrote:
> 
> Hello,
> I just started learning perl on my own.
> I was writing a simple program that counts number of lines, words and
> characters from a given file.
> This code is from the book,
> 
> while (<INFILE>)
> {
>     $TheLine = $_;
>     chomp($TheLine);
>     $Linecount = $Linecount + 1;
>     $LineLen = length($TheLine);
>     $Charcount = $Charcount + $LineLen;
> ....
> ...
> ...
> }
> 
> but this program gets stuck at
> $TheLine =$_;
> From the book, that line is supposed to save the line's contents.
> I guess my perl doesn't recognize $_ thing.
> Does anyone have any suggestion for me?
> do i need to upgrade my perl?
> I'm using the one that came with Redhat5.2.
> thank you.

-- 
Matthew O. Persico
http://www.erols.com/mpersico
http://www.digistar.com/bzip2


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

Date: Mon, 15 Feb 1999 02:11:21 +0100
From: n8twatch <n8twatch@usa.net>
Subject: package reference???
Message-Id: <36C77439.C882471F@usa.net>

is it possible to build a reference to a package, like with the
arrays($refarray = \@array;) or with scalars.

thx in advance,
alias n8twatch.


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

Date: Mon, 15 Feb 1999 04:46:36 GMT
From: william@netexpress.net (william cunningham)
Subject: PAM conversation script?
Message-Id: <24D5AC53287586A7.837BAEA567523010.360E8D25548203F9@library-proxy.airnews.net>

Hello,

I am looking for a PAM conversation script that I could use with the
Authen::PAM module.

Thanks.

DC
--


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

Date: Mon, 15 Feb 1999 01:45:41 +0000
From: Tapio Laxstrom <tapio@vtoy.fi>
Subject: problem with Hash refs in s///
Message-Id: <36C77C45.750@vtoy.fi>

#Please tell me where i'm doing something wrong?
#Here is my problem (sorry if it's long)
#First create 2 hashes
%hash1 = ("key1" => "key1_in_hash1",
          "key2" => "key2_in_hash1");
%hash2 = ("key1" => "key1_in_hash2",
          "key2" => "key2_in_hash2");
#take references and put those in array
push(@arr1,\%hash1); push(@arr1,\%hash2);
#then take string from template file with <replacement> syntax
$string1 = "Keys: <key1> and <key2>\n";
push(@arr2,$string1);
#and now print hashes trough string
#(and replace <keys> with hash keys)
foreach $record (@arr1) {
  foreach $string (@arr2) {
	#this is for debuging (works fine with both hashes)
    print "Keys: ".$record->{"key1"}."and".$record->{"key2"}."\n";   
    #but can someone explain me next line in hash 2 (3,4,...)???
    $string =~ s/<(.*?)>/$record->{"$1"}/g;   
    print $string;
    
    #WHY IT KEEPS GETTING VALUES FROM HASH 1 ?????
  };
};


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

Date: Mon, 15 Feb 1999 02:18:44 GMT
From: lovena@netway.com
Subject: script to forward email
Message-Id: <7a805u$f63$1@nnrp1.dejanews.com>

I am looking for a script to forward email.  I intend to use it on my
email-pals club on my site (to hide email addys).

I've done a search on Yahoo and Matt's Script Archive and come up with zero. 
Can anyone provide me with some help/leads?

Also, any comments on the "Perl 5" publicaiton?  Just curious as I am
considering purchasing this.

TIA,
Lovena

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Sun, 14 Feb 1999 21:02:07 -0800
From: Stephen F Palincsar <palincsars.isc@gao.gov>
Subject: Re: Simple question of the beginner.
Message-Id: <36C7AA4F.1535@gao.gov>

Yuriy Tenenbaum wrote:
> 
> I am doing my first assignment and everything is fine except the last
> question:  I have an array of strings.  I need to remove the last
> character of the second element and add this character 3 times to the
> end of the second last element of that array.

Do you know how to access the second element in an array?

Do you know how to take a substring of a scalar?

Do you know how to concatenate strings?

Break the problem apart into manageable pieces and do not worry about
how many lines it takes.

Incidentally, this is pretty advanced for a _first_ assignment. 
Generally
a first assignment is something like "print 'Hello world';"



> 
> I browsed through the textbook and can't find anything on that.
> I also know that it should be just a couple of lines of code.
> Does anyone know how to accomplish that?
> 
> I will appreciate that very, very much.
> 
> Sergey


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

Date: Sun, 14 Feb 1999 22:33:08 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Simple question of the beginner.
Message-Id: <alecler-1402992233080001@dialup-681.hip.cam.org>

In article <36C74932.6E3BAD6E@ix.netcom.com>, yuriyt@ix.netcom.com wrote:

> I am doing my first assignment and everything is fine except the last
> question:  I have an array of strings.  I need to remove the last
> character of the second element and add this character 3 times to the
> end of the second last element of that array.
> 
> I browsed through the textbook and can't find anything on that.
> I also know that it should be just a couple of lines of code.

You mean, like

   $array[-2] .= chop($array[1]) x 3;

Andre


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

Date: Sun, 14 Feb 1999 20:55:14 -0800
From: Stephen F Palincsar <palincsars.isc@gao.gov>
Subject: Re: String splitting.
Message-Id: <36C7A8B2.3DDC@gao.gov>

Well sure, the ambiguity's the thing.  As for the English learning 
English, what can I possibly say that would add to GBS's comments in
Pygmailion?  But if you want to learn English as spoken on the east
bank of the Atlantic, one can do lots better than MTV.  How about
Eastenders?


Jonathan Stowe wrote:
> 
> On Thu, 11 Feb 1999 19:48:06 -0500 Steve Palincsar wrote:
> > I'm pretty sure what Frank means by "full stop" is
> > the character we speak of as "period".
> 
> Hey I'm *certain* thats what he means.  Not everyone for whom English
> is a second language learns it from MTV you know ;-}
> 
> >                                         In this case,
> > the point is the special meaning of . in a regexp,
> > if that is the chosen solution.
> >
> 
> Ah but that is a dot rather than a full stop/period isnt it :-?

That, I believe, is because the original poster forgot to backwhack
it, producing unexpected results.
> /J\
> --
> Jonathan Stowe <jns@btinternet.com>
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
> Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>


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

Date: Sun, 14 Feb 1999 12:23:48 -0500
From: Eric Windisch <southpark@nni.com>
Subject: V-day Perl Poetry
Message-Id: <36C706A4.B924C36F@nni.com>

This is my first perl-poem, and isn't very good... dunno if it even
parses, but what the hell :)


open (HEART, "for_me");
for($this-valentines-day; $you and $me; $together++) {
$you = "My special one";
$me = "Your darling";
}
while($you = push(@me, @away)) {
foreach(@second) {
die a_bit to my $death;
goto hell; 
} 
pack @my_bags @and_leave;
package my_love
if($i_do_not_see_you) {
write YOU_SOON;
}
}
reverse the keys of time;
bless me;
for(the last time; kill $me;) {
if($i) use $you;


- Eric Windisch


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

Date: Sun, 14 Feb 1999 21:27:28 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: V-day Perl Poetry
Message-Id: <comdog-ya02408000R1402992127280001@news.panix.com>

In article <36C706A4.B924C36F@nni.com>, Eric Windisch <southpark@nni.com> posted:

> This is my first perl-poem, and isn't very good... dunno if it even
> parses, but what the hell :)
> 
> 
> open (HEART, "for_me");

sure you didn't want to open that for writing

   open (HEART, "> for_me")

and then check to see if it worked

   or warn "oops, sorry to bother you";

? 

[nice job, btw ;]

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Mon, 15 Feb 1999 04:03:11 GMT
From: beenz@nycap.rr.com (Joseph Java)
Subject: Re: Windoze Dial up networking with PERL
Message-Id: <36c79cd1.12144733@news.nycap.rr.com>

On Thu, 04 Feb 1999 08:38:09 +0000, ursa@ici.net wrote:

>Gary Robson wrote:
>
>> I have a script (using libnet) for inspecting my pop3 e-mail account and
>> downloading e-mail with certain subjects for processing.  While Windows
>> automatically dials up my ISP automatically when the script I can't find any
>> way of closing the Dial-up connection afterwards (somthing I need because
>> the script will be run hourly with a scheduler).  Any help or advice
>> (especially with a small example, I still a PERL novice) would be greatly
>> appreciated.
>>
>>                                     Cheers
>>                                             gary@altmedia.freeserve.co.uk
>
>
>Hi Gary,
>
>No solution here but I seek the same little code snipplet!
>
>I would really like to work the dial-up process and start, monitor AND
>disconnect from my perl program. Maybee a post to a Visual Basic newsgroup would
>help?
>
>- Ursa
>
>
>
>
Is there an expect for windows?
-JJ


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 4894
**************************************

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