[11374] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4974 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 26 11:37:28 1999

Date: Fri, 26 Feb 99 08:28: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           Fri, 26 Feb 1999     Volume: 8 Number: 4974

Today's topics:
        getpw*() don't use shadow password file <gehring@politik.uni-mainz.de>
    Re: getpw*() don't use shadow password file <tchrist@mox.perl.com>
        Getting a Unix script running on NT? (Brent Singers)
    Re: Getting a Unix script running on NT? <tavi367@ibm.net>
        Getting PID at process start up time <psala@btv.ibm.com>
    Re: Getting PID at process start up time <jeromeo@atrieva.com>
    Re: Getting PID at process start up time (Greg Bacon)
    Re: Getting PID at process start up time <psala@btv.ibm.com>
    Re: Getting PID at process start up time <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: Getting PID at process start up time <jeromeo@atrieva.com>
        Getting specfic items in an array and loop through to a <jaybyrd@macs.net>
        Getting user ID and password in perl script (Seshu Madhavapeddy)
    Re: Getting user ID and password in perl script <Tony.Curtis+usenet@vcpc.univie.ac.at>
        glob under Solaris and Linux <husmann@digitalmap.hi.bosch.de>
    Re: glob under Solaris and Linux <uri@home.sysarch.com>
    Re: glob under Solaris and Linux <husmann@digitalmap.hi.bosch.de>
    Re: glob under Solaris and Linux <backes@rhrk.uni-kl.de>
    Re: Got a modification to do, please help (Ronald J Kimball)
    Re: Got a modification to do, please help <uri@ibnets.com>
        Graphic Counter No SSI <kram@techie.com>
        Gtk::Dialog alpha 1 <ac212@cam.ac.uk>
    Re: guestbook perl script <woodwort@utmc.utc.com>
    Re: guestbook perl script <Allan@due.net>
    Re: guestbook perl script (Ethan H. Poole)
        hash of arrays kendall.krueger@amd.com
    Re: hash of arrays (Sam Holden)
        hash question <yzhu@mindspring.com>
    Re: hash question <Allan@Due.net>
    Re: hash question <uri@ibnets.com>
    Re: hash question <Allan@Due.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 22 Feb 1999 12:47:24 +0100
From: "Uwe W. Gehring" <gehring@politik.uni-mainz.de>
Subject: getpw*() don't use shadow password file
Message-Id: <36D143CC.C25E211D@politik.uni-mainz.de>

Hi,

the FAQ:

"If perl was installed correctly, the getpw*() functions described in
the perlfunc manpage provide (read-only) access to the shadow password
file."

My perl installation seems not to use the shadow password file but the
passwd file. How can I fix this?

-- 

Sincerely
Uwe W. Gehring

Research Assistant
****************************************************
University of Mainz - Institute of Political Science
Saarstr. 21          55099 Mainz             Germany
Tel.: +49 6131 39-5485         Fax: +49 6131 39-2996
E-Mail:                 gehring@politik.uni-mainz.de
WWW:                http://www.uni-mainz.de/~gehring
****************************************************


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

Date: 22 Feb 1999 06:30:46 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: getpw*() don't use shadow password file
Message-Id: <36d15c06@csnews>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    "Uwe W. Gehring" <gehring@politik.uni-mainz.de> writes:
:the FAQ:
:
:"If perl was installed correctly, the getpw*() functions described in
:the perlfunc manpage provide (read-only) access to the shadow password
:file."
:
:My perl installation seems not to use the shadow password file but the
:passwd file. How can I fix this?

The proper way to do this is demonstrated in the manpage:

    These routines have been written to ``shadow'' the password file,
    e.g.  allow only certain programs to have access to the encrypted
    password.  If the process which calls them has an effective uid of
    0, the encrypted password will be returned, otherwise, the password
    field of the returned structure will point to the string `*'.

Therefore, if your vendor decided you should get a differently-named
function to get at the functionality, they have screwed you and you lose.
They've probably also screwed up and given you functions named dumb
things like ftell64() and llseek() as well.  Don't you hate it when
people who can do so instead choose not to make clean, programmer-friendly
design decisions?

Sorry, it's a pet peeve of mine.

--tom
-- 
If mathematically you end up with the wrong answer, try multiplying by
the page number.


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

Date: Wed, 24 Feb 1999 20:52:51 GMT
From: brent.s@ihug.co.nz (Brent Singers)
Subject: Getting a Unix script running on NT?
Message-Id: <36d464ef.59156640@news.ihug.co.nz>

I wrote some perl scripts a while ago for a friend who was going to be
running them on a Linux system.  Now he is needing to get them going
on an NT server.  Is there a quick easy way to get around the
differences?

The scripts don't do anything amazing really, just getting values from
a webpage, some calculating, printing HTML and mailing.  The two
things I know I need to fix (and as yet have been unable to find the
answers), are these:

1) The first line that reads #!/usr/bin/perl.  What is the NT
equivilent?

2) The mail thing.  Obviously endmail is not an option - the server
the scripts are being moved too has had Blat set up for him.  Are
there any differences between using this and sendmail?

Thanks a heap for any help .....

Brent


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

Date: Wed, 24 Feb 1999 20:51:49 -0600
From: "Walter" <tavi367@ibm.net>
Subject: Re: Getting a Unix script running on NT?
Message-Id: <36d4bb08@news1.us.ibm.net>

Brent Singers wrote in message <36d464ef.59156640@news.ihug.co.nz>...
>I wrote some perl scripts a while ago for a friend who was going to be
>running them on a Linux system.  Now he is needing to get them going
>on an NT server.  Is there a quick easy way to get around the
>differences?
>
>The scripts don't do anything amazing really, just getting values from
>a webpage, some calculating, printing HTML and mailing.  The two
>things I know I need to fix (and as yet have been unable to find the
>answers), are these:
>
>1) The first line that reads #!/usr/bin/perl.  What is the NT
>equivilent?


Unless your running Apache, just leave it.
That way it will un on both, no problem.


>2) The mail thing.  Obviously endmail is not an option - the server
>the scripts are being moved too has had Blat set up for him.  Are
>there any differences between using this and sendmail?


Sorry, havn't gone there yet.

If you find out, please pass it along!

Walter





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

Date: Thu, 25 Feb 1999 12:09:14 -0500
From: "Paul J. Sala" <psala@btv.ibm.com>
Subject: Getting PID at process start up time
Message-Id: <36D583BA.3D7567F4@btv.ibm.com>

In perl how do I get the PID of a process at the time the
process is started. For example in psedo code I would
like to start xcalc and get it's PID:

 xcalcsPID = xcalc

I know how to get the PID after the process is started, by 
using ps and grep commands but that's not bullet proof.

Actualy I need this functionality in both ksh and perl, so
I'll take solutions in both perl and ksh.

I searched the Unix FAQ, no luck there.

Thanks....Paul


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

Date: Thu, 25 Feb 1999 10:41:52 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: "Paul J. Sala" <psala@btv.ibm.com>
Subject: Re: Getting PID at process start up time
Message-Id: <36D59970.4E48CAE5@atrieva.com>

Paul J. Sala wrote:
> 
> In perl how do I get the PID of a process at the time the
> process is started. For example in psedo code I would
> like to start xcalc and get it's PID:
> 
>  xcalcsPID = xcalc

$xcalcsPID = $$;

Same as shells.  Just like it says in the documentation.  For all the
exciting details on $$, and other predefined perl variables, read the
perlvar documentation that came with your distribution.

perldoc perlvar

> Thanks....Paul

De Nada.

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: 25 Feb 1999 18:14:32 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Getting PID at process start up time
Message-Id: <7b43u8$7ev$2@info.uah.edu>

In article <36D583BA.3D7567F4@btv.ibm.com>,
	"Paul J. Sala" <psala@btv.ibm.com> writes:
: In perl how do I get the PID of a process at the time the
: process is started. For example in psedo code I would
: like to start xcalc and get it's PID:
: 
:  xcalcsPID = xcalc
: 
: I know how to get the PID after the process is started, by 
: using ps and grep commands but that's not bullet proof.

>From the documentation on fork() in perlfunc:

    Does a fork(2) system call.  Returns the child pid to the parent
    process, 0 to the child process, or undef if the fork is
    unsuccessful.

To do what you want, you could fork() off a child and exec() xcalc
in the child.  fork() will return the child's pid to the parent.

Greg
-- 
We are Fudd of Borg: Pwepawre to be aswimiwated.


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

Date: Thu, 25 Feb 1999 14:05:44 -0500
From: "Paul J. Sala" <psala@btv.ibm.com>
Subject: Re: Getting PID at process start up time
Message-Id: <36D59F08.5E56BF4B@btv.ibm.com>


Jerome,

I tried:


xcalc;                                                                          
 $xcalcPID = $$;

but $xcalcPID contained the PID of the perl script
not the PID of xcalc.

 .....Paul 


Jerome O'Neil wrote:
> 
> Paul J. Sala wrote:
> >
> > In perl how do I get the PID of a process at the time the
> > process is started. For example in psedo code I would
> > like to start xcalc and get it's PID:
> >
> >  xcalcsPID = xcalc
> 
> $xcalcsPID = $$;
> 
> Same as shells.  Just like it says in the documentation.  For all the
> exciting details on $$, and other predefined perl variables, read the
> perlvar documentation that came with your distribution.
> 
> perldoc perlvar
> 
> > Thanks....Paul
> 
> De Nada.

-- 
Regards.........Paul Sala (psala@btv.ibm.com)


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

Date: 25 Feb 1999 19:58:46 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Getting PID at process start up time
Message-Id: <8390dmb995.fsf@vcpc.univie.ac.at>

Re: Getting PID at process start up time, Paul
<psala@btv.ibm.com> said:

Paul> I know how to get the PID after the process is
Paul> started, by using ps and grep commands but
Paul> that's not bullet proof.

perldoc perlipc.

See the examples about using fork() and the implicit
fork() on pipe opens.

Fork a child and exec your command in it.  The
parent then knows the pid of the child.

Paul> Actualy I need this functionality in both ksh
Paul> and perl, so I'll take solutions in both perl
Paul> and ksh.

For ksh, you'd probably need to go the "ps" route.

-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Thu, 25 Feb 1999 12:22:03 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: "Paul J. Sala" <psala@btv.ibm.com>
Subject: Re: Getting PID at process start up time
Message-Id: <36D5B0EA.B9175053@atrieva.com>

Paul J. Sala wrote:
> 
> Jerome,
> 
> I tried:
> 
> xcalc;
>  $xcalcPID = $$;
> 
> but $xcalcPID contained the PID of the perl script
> not the PID of xcalc.

Ah, I misunderstood the problem.  Check out the documentation on fork()
and also the perlipc document, which has examples of what you want.

You could also use a pipe with open(), which will return the pid of the
child process, but there are some caveats to this method.

You might also want to look at IPC::Open2 and IPC::Open3.

Good Luck!

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Fri, 26 Feb 1999 09:48:00 -0500
From: "Bill Chase" <jaybyrd@macs.net>
Subject: Getting specfic items in an array and loop through to all
Message-Id: <7b6c7b$6gb$1@news0-alterdial.uu.net>

I think I'm having a mental block. I know this should be simple but this is
not working. Hopefully one of you perl gurus can straighten me out.

This is the routine after items found and prints them out. Works fine.

sub print_record {
   print "<BR>\n";
#<!-- this is all 1 line-->
 print "<input type=\"checkbox\" name=\"page_id\" value
=\"$doc_title,$doc_url\" checked><A
HREF=\"http:\/\/www.myserver.com\/testscripts\/excerpt.html\"
target=\"blank\">" .  $doc_title . "</A></B>\n";
  #<!-- line ends here-->

}#sub closed

 I need to pass $doc_url along with $doc_title. Only the $doc_title will be
displayed next to the checkbox. $doc_url will be hidden in order to take the
selections made on to the next step

 
$page_id = $form{'page_id'};
 @page_id = split(/,/, $page_id);
 
 foreach $item (@page_id){
     print "\n<input type=\"hidden\" name=\"finalpage\" value =\"$item\">";
     print "$item </B>";
    }

I know the above is not correct but its a start. I have had variations on
the above that would get the second item in the array by using
 something like @page_id[1];

Problem was I could not get it to loop through all the separate items that
were selected next to the checkboxes. It would only show the first selection
item.

 I just haven't been able to put all the pieces together.

Help!

-Bill






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

Date: 25 Feb 1999 11:46:07 GMT
From: trinity@bnr.ca (Seshu Madhavapeddy)
Subject: Getting user ID and password in perl script
Message-Id: <7b3d5v$13f$2@crchh14.us.nortel.com>

I am using O'Reilley web server on Windows 95. When users login the ID
and password are entered in a dialog box. I need to get the ID and 
password in a perl script for validation. How do I do this

Thanx for any help,
Mohan




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

Date: 25 Feb 1999 15:20:52 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Getting user ID and password in perl script
Message-Id: <83g17ulg3f.fsf@vcpc.univie.ac.at>

Re: Getting user ID and password in perl script,
Seshu <trinity@bnr.ca> said:

Seshu> I am using O'Reilley web server on Windows
Seshu> 95. When users login the ID and password are
Seshu> entered in a dialog box. I need to get the ID
Seshu> and password in a perl script for
Seshu> validation. How do I do this

I presume you mean the dialog generated by the
browser software?  So it's an HTTP challenge
user/password you're talking about.

You can get the user via CGI.pm's remote_user()
method, but you can't get the password.

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Wed, 24 Feb 1999 09:09:08 +0100
From: "Michael Husmann;PTP" <husmann@digitalmap.hi.bosch.de>
Subject: glob under Solaris and Linux
Message-Id: <36D3B3A4.B3205896@digitalmap.hi.bosch.de>

 Does someone know why:

system "ls ~"

works fine under Linux while Solaris says  "~: No such file or
directory"

--
Michael Husmann
p.A. Robert Bosch Data GmbH, Postfach 77 77 77, D-31132 Hildesheim
PHONE: +(49) 5121 49 4876, FAX: +(49) 5121 4815
e-mail: Michael.Husmann@digitalmap.hi.bosch.de





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

Date: 24 Feb 1999 03:20:19 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: glob under Solaris and Linux
Message-Id: <x7hfscjjr0.fsf@home.sysarch.com>

>>>>> "MH" == Michael Husmann;PTP <husmann@digitalmap.hi.bosch.de> writes:

  MH>  Does someone know why:
  MH> system "ls ~"

  MH> works fine under Linux while Solaris says  "~: No such file or
  MH> directory"

because of the default shell used on each system. solaris uses plain old
sh which does not grok ~ like many other shells do. linux uses either
bash or ksh IIR for its main shell which grok's ~.

moral: don't do shell specific operations in system or anything in perl
which calls a shell.

hth,

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Wed, 24 Feb 1999 09:51:24 +0100
From: "Michael Husmann;PTP" <husmann@digitalmap.hi.bosch.de>
Subject: Re: glob under Solaris and Linux
Message-Id: <36D3BD8C.B69BC534@digitalmap.hi.bosch.de>

Uri Guttman wrote:

> >>>>> "MH" == Michael Husmann;PTP <husmann@digitalmap.hi.bosch.de> writes:
>
>   MH>  Does someone know why:
>   MH> system "ls ~"
>
>   MH> works fine under Linux while Solaris says  "~: No such file or
>   MH> directory"
>
> because of the default shell used on each system. solaris uses plain old
> sh which does not grok ~ like many other shells do. linux uses either
> bash or ksh IIR for its main shell which grok's ~.
>
> moral: don't do shell specific operations in system or anything in perl
> which calls a shell.
>
> hth,
>
> uri
>
> --
> Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
> Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
> uri@sysarch.com  ------------------------------------  http://www.sysarch.com
> The Best Search Engine on the Net -------------  http://www.northernlight.com

Thank you so much. That explains.

Best regards,
Michael

--
Michael Husmann
p.A. Robert Bosch Data GmbH, Postfach 77 77 77, D-31132 Hildesheim
PHONE: +(49) 5121 49 4876, FAX: +(49) 5121 4815
e-mail: Michael.Husmann@digitalmap.hi.bosch.de





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

Date: Wed, 24 Feb 1999 09:52:58 +0100
From: Joachim Backes <backes@rhrk.uni-kl.de>
To: Michael.Husmann@digitalmap.hi.bosch.de
Subject: Re: glob under Solaris and Linux
Message-Id: <36D3BDEA.F54BE058@rhrk.uni-kl.de>


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

"Michael Husmann;PTP" wrote:

Hello, this depends on the shell you are using, because system("ls -l")
always starts
a shell when used in this manner.The character "~" is not by all shells
understood as shortcut for the home directory. The Linux bash knows ~ as
home
directory. Under Solaris ~ is not known by the bourne shell, only by ksh
or csh
or tcsh. Solution: try system("ksh -c 'ls ~'"); or system("csh -c 'ls
~'");


>  Does someone know why:
>
> system "ls ~"
>
> works fine under Linux while Solaris says  "~: No such file or
> directory"
>
> --
> Michael Husmann
> p.A. Robert Bosch Data GmbH, Postfach 77 77 77, D-31132 Hildesheim
> PHONE: +(49) 5121 49 4876, FAX: +(49) 5121 4815
> e-mail: Michael.Husmann@digitalmap.hi.bosch.de

Regards

--
Joachim Backes        | Univ. of Kaiserslautern
Computer Center, Supercomputing Division     | Phone: +49-631-205-2438
D-67653 Kaiserslautern, PO Box 3049, Germany | Fax:   +49-631-205-3056
---------------------------------------------+------------------------
WWW: http://sgi400.rhrk.uni-kl.de/home/mitarbeiter/backes.html



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

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
"Michael Husmann;PTP" wrote:
<p>Hello, this depends on the shell you are using, because system("ls -l")
always starts
<br>a shell when used in this manner.The character "~" is not by all shells
<br>understood as shortcut for the home directory. The Linux bash knows
~ as home
<br>directory. Under Solaris ~ is not known by the bourne shell, only by
ksh or csh
<br>or tcsh. Solution: try system("ksh -c 'ls ~'"); or system("csh -c 'ls
~'");
<br>&nbsp;
<blockquote TYPE=CITE>&nbsp;Does someone know why:
<p>system "ls ~"
<p>works fine under Linux while Solaris says&nbsp; "~: No such file or
<br>directory"
<p>--
<br>Michael Husmann
<br>p.A. Robert Bosch Data GmbH, Postfach 77 77 77, D-31132 Hildesheim
<br>PHONE: +(49) 5121 49 4876, FAX: +(49) 5121 4815
<br>e-mail: Michael.Husmann@digitalmap.hi.bosch.de</blockquote>
Regards
<pre>--&nbsp;
Joachim Backes&nbsp;<backes@rhrk.uni-kl.de>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Univ. of Kaiserslautern
Computer Center, Supercomputing Division&nbsp;&nbsp;&nbsp;&nbsp; | Phone: +49-631-205-2438&nbsp;
D-67653 Kaiserslautern, PO Box 3049, Germany | Fax:&nbsp;&nbsp; +49-631-205-3056&nbsp;
---------------------------------------------+------------------------
WWW: <A HREF="http://sgi400.rhrk.uni-kl.de/home/mitarbeiter/backes.html">http://sgi400.rhrk.uni-kl.de/home/mitarbeiter/backes.html</A></pre>
&nbsp;</html>

--------------DB34BB19AF39F422CB8F9B45--



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

Date: Sun, 21 Feb 1999 16:42:13 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Got a modification to do, please help
Message-Id: <1dnl3og.1sfo66q1yygg3kN@bay3-468.quincy.ziplink.net>

Mec <unpaul@hotmail.com> wrote:

> Steve Linberg a icrit dans le message ...
> >In article <7aovr6$hvl$1@front3.grolier.fr>, "Mec" <unpaul@hotmail.com>
> wrote:
> >
> >> Here is the current code, please tell me how to modify it so it will let
> url
> >> starting by news:
> >
> >if ($url_to_check !~ /^(ftp|http|nntp|news):\/\/\S+\.\S+/) { return(1); }
> 
> Thanks a lot for your help, but your code allow news:// and it's not like
> news: (without the //)
> 
> Do you have another solution to allow news: ?

I believe it's time for you to learn Perl...
Regular expressions in particular.


/^(?:(?:f|h|nn)tp:\/\/|news:)\S+\.\S+/


Match either [ f, or h, or nn, followed by tp:// ] or [ news: ] followed
by the rest of the URL.

-- 
 _ / '  _      /         - aka -          rjk@linguist.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
perl -e'$_="\012534`!./4(%2`\cp%2,`(!#+%2j";s/./"\"\\c$&\""/gees;print'


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

Date: 22 Feb 1999 16:44:50 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: Got a modification to do, please help
Message-Id: <3990dqun8t.fsf@ibnets.com>

>>>>> "RJK" == Ronald J Kimball <rjk@linguist.dartmouth.edu> writes:


  RJK> /^(?:(?:f|h|nn)tp:\/\/|news:)\S+\.\S+/

hey ronald,

you like leaning toothpicks? might as well teach the guy alternative
delimiters.

uri


-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ironbridgenetworks.com	


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

Date: Mon, 22 Feb 1999 19:03:24 -0000
From: "Kram" <kram@techie.com>
Subject: Graphic Counter No SSI
Message-Id: <eQhA2.10437$_3.737@stones>

hi anyone
CGI newbie , anyone got a graphical counter that does not need SSI
or GD.pm support ??

kram

(perl5 on our server but not SSI yet!)




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

Date: 23 Feb 1999 17:03:20 GMT
From: Alistair Cunningham <ac212@cam.ac.uk>
Subject: Gtk::Dialog alpha 1
Message-Id: <7aun0o$tbu$1@play.inetarena.com>


Announcing the first alpha release of Gtk::Dialog, a simple interface
for creating dialog boxes in Gtk.

This release is suitable for experts only. Get it from:

http://thor.cam.ac.uk/~ac212/GtkDialog/GtkDialog-alpha1.tar.gz 

This module will probably appear on CPAN sometime.


Alistair Cunningham.

-- 
--------------------------------------------------------------------------
 Alistair Cunningham   Selwyn College, Cambridge   Email: ac212@cam.ac.uk




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

Date: Mon, 22 Feb 1999 13:12:22 -0700
From: Robert Woodworth <woodwort@utmc.utc.com>
Subject: Re: guestbook perl script
Message-Id: <36D1BA26.89B0AB1E@utmc.utc.com>

Cesar Romani wrote:
> 
> You should use "/" and not "\":
> 
> $file = "D:/Customer Sites/DStern/cgi-bin/guestbook.dat";

NO!  you should use "\", but not with double quote, use it with single
quote:

$file = 'D:\Customer Sites\DStern\cgi-bin\guestbook.dat';

Remember dos uses \, and in perl, double quotes interpretes the data
with meta-chars  \$@&

And use CGI.pm  :)


> 
> On Fri, 19 Feb 1999 20:36:30 -0500, Anonymous wrote:
> >Has anyone ever written a *working* guestbook script for an NT server?  If
> >so, please assist me...if not, please assist me =)
> >
> >My guestbook.pl script:
> >
> >
> >#GUESTBOOK.PL
> >
> >$file = "D:\Customer Sites\DStern\cgi-bin\guestbook.dat";
> >$date = localtime(time);
> >
> >$ENV{"REQUEST_METHOD"} eq "POST" ? &Add_Guest($file) :
> >&Display_Book($file);
> >
> >
> >
> >It returns the error:
> >'D:\User Space\Webmaster\cgi-bin\guestbook.pl' script produced no output
> >
> >Please give me some help on this.  Thank you.
> >
> >
> >
> 
> --
> Cesar Romani
> Hamburg, Germany


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

Date: Mon, 22 Feb 1999 16:32:30 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: guestbook perl script
Message-Id: <7asi14$gvu$1@camel19.mindspring.com>

Robert Woodworth wrote in message <36D1BA26.89B0AB1E@utmc.utc.com>...
:Cesar Romani wrote:
:>
:> You should use "/" and not "\":
:>
:> $file = "D:/Customer Sites/DStern/cgi-bin/guestbook.dat";
:
:NO!  you should use "\", but not with double quote, use it with single
:quote:


Calm down there <g>.

:$file = 'D:\Customer Sites\DStern\cgi-bin\guestbook.dat';
:Remember dos uses \, and in perl, double quotes interpretes the data

:with meta-chars  \$@&


Actually dos uses either one (technically one is a little harder to use) so
$file = "D:/Customer Sites/DStern/cgi-bin/guestbook.dat";
works just fine.  Try it, you will like it.  Your scripts won't break when
you move them back and forth between different enviornments.

HTH

AmD






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

Date: Mon, 22 Feb 1999 21:58:45 GMT
From: ehpoole@ingress.com (Ethan H. Poole)
Subject: Re: guestbook perl script
Message-Id: <pqkA2.127$MI5.732@news15.ispnews.com>

[Posted and Emailed]  In article <36D1BA26.89B0AB1E@utmc.utc.com>, 
woodwort@utmc.utc.com says...
>
>Cesar Romani wrote:
>> 
>> You should use "/" and not "\":
>> 
>> $file = "D:/Customer Sites/DStern/cgi-bin/guestbook.dat";
>
>NO!  you should use "\", but not with double quote, use it with single
>quote:

A rather authoratative response.  Unfortunately you've now scared the dickens 
out of every DOS/Win32 newbie and provided them with totally erroneous 
information.

There is nothing wrong with using a forward slash (/) for directory names in 
Perl on DOS/Win32 platforms.  You can even get away with it within Win32 
consoles if you quote the file path to prevent it from being parsed as a 
series of arguments (e.g. dir "/users").  The OS treats both equally.

-- 
Ethan H. Poole              | Website Design and Hosting,
                            | CGI Programming (Perl & C)..
========Personal=========== | ============================
* ehpoole @ ingress . com * | --Interact2Day, Inc.--
                            | http://www.interact2day.com/



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

Date: Wed, 24 Feb 1999 08:52:35 GMT
From: kendall.krueger@amd.com
Subject: hash of arrays
Message-Id: <7b0ekh$5lr$1@nnrp1.dejanews.com>

Hello,
I want to push an element into a hash of arrays, but it seems like the
interpreter does not like this.
ie.  i try     %hash
               push($hash{$key}, $element)

     or even this to force an array
                $hash{$key}[0] = "init"
                push($hash{$key}, $element)

but I still get interpreter errors.
any help is appreciated.
kendall

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


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

Date: 24 Feb 1999 10:33:43 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: hash of arrays
Message-Id: <slrn7d7lc7.ob.sholden@pgrad.cs.usyd.edu.au>

On Wed, 24 Feb 1999 08:52:35 GMT, kendall.krueger@amd.com wrote:
>Hello,
>I want to push an element into a hash of arrays, but it seems like the
>interpreter does not like this.
>ie.  i try     %hash
>               push($hash{$key}, $element)

You could try reading the documentation that comes with perl.
perlref and perllol might be useful...

push(@{$hash{$key}},$element); might be want you want, but why trust me
when the answer is found in the documentation that comes with perl.


-- 
Sam

Basically, avoid comments. If your code needs a comment to be
understood, it would be better to rewrite it so it's easier to
understand.	--Rob Pike


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

Date: Tue, 23 Feb 1999 16:40:37 -0600
From: Yan Zhu <yzhu@mindspring.com>
Subject: hash question
Message-Id: <36D32E64.AC82F864@mindspring.com>


hey guys:
    any way I can create a hash with only keys and feed the values
later? something like this:

    % test = {"a","",
                    "b","",
                    "c",""}

    values{%test} = @value;

of course this doesn't work, but is there a way?
thanks a lot. email also if not too much trouble please.

thank you

yan




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

Date: Tue, 23 Feb 1999 18:00:29 -0500
From: "Allan M. Due" <Allan@Due.net>
Subject: Re: hash question
Message-Id: <UqGA2.568$986.11766@nntp1.nac.net>

Yan Zhu wrote in message <36D32E64.AC82F864@mindspring.com>...
:
:hey guys:
:    any way I can create a hash with only keys and feed the values
:later? something like this:
:    % test = {"a","",
:                    "b","",
:                    "c",""}
:
:    values{%test} = @value;
:of course this doesn't work, but is there a way?
:thanks a lot. email also if not too much trouble please.


You are looking for a hash slice.
@keys=qw(a b c);
@values = qw(one two three);
@test{@keys} = "";
Then later:
@test{@keys} = @values;

HTH

AmD
[posted and emailed]
--
$email{'Allan M. Due'} =' Allan@Due.net '
--random quote--
When you come to a fork in the road take it.
  Yogi Berra




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

Date: 23 Feb 1999 18:19:08 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: hash question
Message-Id: <39ww18pv2r.fsf@ibnets.com>

>>>>> "AMD" == Allan M Due <Allan@Due.net> writes:

  AMD> @keys=qw(a b c);
  AMD> @values = qw(one two three);
  AMD> @test{@keys} = "";

hash slices are great but you should initialize them with lists or
arrays and not a single scalar. in your case $test{a} is '' while the
other 2 are undef.

this is more consistant, idiomatic and assigns undef to all of the keys. 

@test{@keys} = () ;

i know the values could/will get overridden later but who knows what
will look at the hash before then?

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ironbridgenetworks.com	


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

Date: Tue, 23 Feb 1999 19:07:05 -0500
From: "Allan M. Due" <Allan@Due.net>
Subject: Re: hash question
Message-Id: <bpHA2.574$986.11804@nntp1.nac.net>

Uri Guttman wrote in message <39ww18pv2r.fsf@ibnets.com>...
:>>>>> "AMD" == Allan M Due <Allan@Due.net> writes:
:  AMD> @keys=qw(a b c);
:  AMD> @values = qw(one two three);
:  AMD> @test{@keys} = "";
:
:hash slices are great but you should initialize them with lists or
:arrays and not a single scalar. in your case $test{a} is '' while the
:other 2 are undef.
:
:this is more consistant, idiomatic and assigns undef to all of the keys.
:
:@test{@keys} = () ;
:i know the values could/will get overridden later but who knows what
:will look at the hash before then?


Well, when I tested the script I used undef but when I posted I decide to go
back and use the original posters example, which was a mistake I should have
avoided.  Thanks for pointing this out.  Edification is always appreciated.

AmD
--
$email{'Allan M. Due'} =' Allan@Due.net '
--random quote--
Algren's Precepts:
Never eat at a place called Mom's. Never play cards with a man
named Doc. And never lie down with a woman who's got more troubles
than you.





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

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

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