[12934] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 344 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 3 01:07:17 1999

Date: Mon, 2 Aug 1999 22:05:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 2 Aug 1999     Volume: 9 Number: 344

Today's topics:
    Re: How can I know what modules are installed on server <Spam@IsBadForTheInternet.com>
    Re: How can I know what modules are installed on server <Spam@IsBadForTheInternet.com>
    Re: How can I know what modules are installed on server <llornkcor@llornkcor.com>
    Re: HTML::Parser and HTML::Entites (Eric Bohlman)
        Jeoparder's Jest <tchrist@mox.perl.com>
    Re: Jeoparder's Jest <uri@sysarch.com>
    Re: mutiple shells running one app (Martien Verbruggen)
    Re: Perl or CGI (Abigail)
    Re: pod2man question (Abigail)
    Re: pod2man question (Martien Verbruggen)
    Re: qq construct (elephant)
    Re: qq construct (Abigail)
    Re: Quoting Strategies and the Jeopardy Game (Abigail)
    Re: Quoting Strategies and the Jeopardy Game <tchrist@mox.perl.com>
        Reading group of files as One ? <itc@cloudnet.com>
    Re: Running scrips on own pc <paulreid@cableinet.co.uk>
    Re: Running scrips on own pc (elephant)
    Re: Running scrips on own pc <paulreid@cableinet.co.uk>
    Re: Sorting array of hashs by a key (Abigail)
    Re: White Camel Awards (brian d foy)
    Re: Whitespace (Martien Verbruggen)
    Re: Why no Perl books at Fry's? (Eric Bohlman)
    Re: Why no Perl books at Fry's? (Jon Bell)
    Re: Windows recursive copy? (William Herrera)
    Re: Working Telnet Script Needed (Martien Verbruggen)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 2 Aug 1999 22:34:01 -0500
From: "99% Energy" <Spam@IsBadForTheInternet.com>
Subject: Re: How can I know what modules are installed on server?
Message-Id: <Zptp3.846$k8.33447@newscene.newscene.com>

> Not our problem.

Who is us?

Thanks anyway :-(

99%

Abigail <abigail@delanet.com> wrote in message
news:slrn7qcckb.rb1.abigail@alexandra.delanet.com...
> 99% Energy (dnor@hiline.net) wrote on MMCLXII September MCMXCIII in
> <URL:news:ouop3.23$k8.8951@newscene.newscene.com>:
> -- Hello,
> --
> -- I am trying to run a script that uses CGI, PWL, etc libraries in a web
> -- hosting server. I downloaded the libraries from CPAN and installed them
in
> -- my computer, which runs win98. The script that uses these additional
> -- libraries runs fine in my computer.
> --
> -- I uploaded the script to the web hosting server (www.icom.com) and the
> -- script failed. I uploaded the libraries to the cgi-bin\lib directory (I
had
> -- to create the directory) and the script still failed. I am tempted to
> -- butcher the library modules and make a large script with all the
functions
> -- but I know this is not the right solution.
> --
> -- Other scripts which do not use library modules run fine on the server.
> --
> -- How can I tell what modules are installed on a server? How can I
replicate
> -- the library enviroment in my machine so it is the same as on the server
so I
> -- won't run into these type of complications?
>
> RTFFAQ.
>
> -- BTW, I do not have Telnet access to the server, only FTP.
>
>
> Not our problem.
>
>
>
> Abigail
> --
>
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47
]
>
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W
]
>
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^
V
> %$^U;$^V/=$^U}while$^V!=$^W'
>
>
>   -----------== Posted via Newsfeeds.Com, Uncensored Usenet News
==----------
>    http://www.newsfeeds.com       The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers
==-----




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

Date: 2 Aug 1999 22:40:16 -0500
From: "99% Energy" <Spam@IsBadForTheInternet.com>
Subject: Re: How can I know what modules are installed on server?
Message-Id: <iwtp3.856$k8.40426@newscene.newscene.com>

> RTFFAQ.

Which of all, there are so many.
Thanks in advance.

99%

Abigail <abigail@delanet.com> wrote in message
news:slrn7qcckb.rb1.abigail@alexandra.delanet.com...
> 99% Energy (dnor@hiline.net) wrote on MMCLXII September MCMXCIII in
> <URL:news:ouop3.23$k8.8951@newscene.newscene.com>:
> -- Hello,
> --
> -- I am trying to run a script that uses CGI, PWL, etc libraries in a web
> -- hosting server. I downloaded the libraries from CPAN and installed them
in
> -- my computer, which runs win98. The script that uses these additional
> -- libraries runs fine in my computer.
> --
> -- I uploaded the script to the web hosting server (www.icom.com) and the
> -- script failed. I uploaded the libraries to the cgi-bin\lib directory (I
had
> -- to create the directory) and the script still failed. I am tempted to
> -- butcher the library modules and make a large script with all the
functions
> -- but I know this is not the right solution.
> --
> -- Other scripts which do not use library modules run fine on the server.
> --
> -- How can I tell what modules are installed on a server? How can I
replicate
> -- the library enviroment in my machine so it is the same as on the server
so I
> -- won't run into these type of complications?
>
> RTFFAQ.
>
> -- BTW, I do not have Telnet access to the server, only FTP.
>
>
> Not our problem.
>
>
>
> Abigail
> --
>
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47
]
>
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W
]
>
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^
V
> %$^U;$^V/=$^U}while$^V!=$^W'
>
>
>   -----------== Posted via Newsfeeds.Com, Uncensored Usenet News
==----------
>    http://www.newsfeeds.com       The Largest Usenet Servers in the World!
> ------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers
==-----




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

Date: 02 Aug 1999 22:46:37 -0600
From: llornkcor <llornkcor@llornkcor.com>
Subject: Re: How can I know what modules are installed on server?
Message-Id: <lnbtcvyq.fsf@wind.localdomain>

dont mind her, or them, they just have some big chip on their
shoulders. Thats their usual reply- read the faq....
Have you contacted your web server's support to ask 
what OS?
what, if any, perl modules are installed, and how to access them?


-- 
llornkcor rocknroll
SpiritShip MultiMedia Recording Studio
www.llornkcor.com
			        (0 0)
+=======================----oOO--(_)--OOo----=========================+
   __   _
  / /  (_)__  __ ____  __    
 / /__/ / _ \/ // /\ \/ /  
/____/_/_//_/\_,_/ /_/\_\
    The choice of a GNU generation...



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

Date: 3 Aug 1999 03:48:19 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: HTML::Parser and HTML::Entites
Message-Id: <7o5oq3$mvp@dfw-ixnews7.ix.netcom.com>

drakek51@my-deja.com wrote:
: I'm looking for an example of using HTML::Parser and HTML::Entites. I
: have a project where I need to parse elements from an HTML page and
: insert information.  More specifically, I need to find the <script>
: element and look for a type attribute.  If the type attribute does not
: exist then I need to insert 'type="text/javascript"'.  It also needs to
: be smart enough to interpret tags that are multiple lines.  Thanks.

I'd suggest looking at the POD for HTML::Filter, which is a subclass of 
HTML::Parser designed specifically to make this sort of thing easy.



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

Date: 2 Aug 1999 21:36:13 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Jeoparder's Jest
Message-Id: <37a663ad@cs.colorado.edu>

# Here's the answer:

for ($pid = fork) {

    not defined	    && do {
			die "cannot fork: $!";
		    }; 

    /^0$/	    && do {
			send_scion();
			exit();
		    };

    /[24680]$/      && do { 
			$eveners++;
			expect_crepuscule();
			last;
		    };

    /[13579]$/      && do { 
			$odders++;
			expect_lutrine();
			last;
		    };

    die "NOT REACHED";

} 


# Now, what's the question? :-)
-- 
I eschew embedded capital letters in names; to my prose-oriented eyes,
they are too awkward to read comfortably.  They jangle like bad typography.
    --Rob Pike


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

Date: 03 Aug 1999 00:29:46 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Jeoparder's Jest
Message-Id: <x7907tlc5h.fsf@home.sysarch.com>

>>>>> "TC" == Tom Christiansen <tchrist@mox.perl.com> writes:

let's see if this cc bounces.

  TC>     /[24680]$/      && do { 
  TC> 			$eveners++;

that should be evenings.

  TC> 			expect_crepuscule();
  TC> 			last;
  TC> 		    };

  TC>     /[13579]$/      && do { 
  TC> 			$odders++;

that should be otters. lutrine is not found anywhere i looked. but
Lutrinae was found

  TC> 			expect_lutrine();
  TC> 			last;
  TC> 		    };

  TC> # Now, what's the question? :-)

whether the child pid is an otter or twilight?

uri


-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: Tue, 03 Aug 1999 03:40:34 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: mutiple shells running one app
Message-Id: <Swtp3.123$8W1.7259@nsw.nnrp.telstra.net>

[Please configure your 'newsreader' to wrap lines somewhere around 72
characters]

On 03 Aug 1999 01:56:37 GMT,
	CLTCEvans <cltcevans@aol.com> wrote:

>How would I write a block of code so that if a condition returns
>true, the perl script executes a program mutiple times? 

my $program = '/path/to/program';
if ($condition)
{
	qx( $program ) for ( 1 .. 10 );
}

>                                                         i have the
>condition statement, but i cant get multiple copies of a program to
>run at once.  do i need a fork?  mutiple system calls?

Oh! _simultaneously_! Why didn't you say so? Yes, you need fork.
Beware that fork does not work on all systems.

>                                                        i would
>appreciate the actual code if anyone can give it to me cause I have
>no idea what it would be like.  i have tried everything i can think
>of.

Did you try reading the documentation?

# perldoc -f fork
[snip]
See also L<perlipc> for more examples of forking and reaping
moribund children.
[snip]

# perldoc perlipc

Lots of examples.

Maybe this will be of help:

#!/usr/local/bin/perl -w
use strict;
use Carp;

my $NumberOfChildren = 5;
my $waitedpid = 0;

sub REAPER
{
	$waitedpid = wait;
	$SIG{CHLD} = \&REAPER; # Grrrrr to SYSV
	logmsg("Reaped $waitedpid" . ($? ? " with exit $?" : ''));
}

$SIG{CHLD} = \&REAPER;

# Spawn NumberOfChildren children
for (my $i = 0; $i < $NumberOfChildren; $i++)
{
	spawn(\&childproc, $i);
}

# Wait for all the children to finish
wait;

# Do post processing here
exit 0;

# Child procedure wrapper
sub childproc
{
	# This is what the children will actually do
	return 0;
}

# This is how we spawn
sub spawn 
{
	my $coderef = shift;

	unless ($coderef && ref($coderef) eq 'CODE')
	{
		confess "USAGE: spawn CODEREF";
	}

	my $pid;

	if (!defined($pid = fork))
	{
		logmsg("cannot fork: $!");
		return;
	}
	elsif ($pid)
	{
		logmsg("Spawned child with pid $pid");
		return; # Parent
	}
	# else I'm the child, go ahead
	exit &$coderef( @_ );
}

# Routine to log some messages to stdout
sub logmsg
{
	print "$0 $$: @_ at ", scalar localtime, "\n";
}


Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.       | Gates?
NSW, Australia                      | 


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

Date: 2 Aug 1999 22:32:48 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl or CGI
Message-Id: <slrn7qcolt.rb1.abigail@alexandra.delanet.com>

Emulov (emulov@NOSPAMsin.khk.be) wrote on MMCLXIII September MCMXCIII in
<URL:news:7o5e4b$ee6$1@nickel.uunet.be>:
|| 
|| I'm thinking of learning Perl or CGI. But I don't have a clear idea of
|| what's the difference between them.

It's the difference of learning how to drive, and how to find your way.

||                                     If I want to write a program that takes
|| form input on my website and write that to some other file, on the server
|| (UNIX), what do I use best?


Python.



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 2 Aug 1999 22:36:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: pod2man question
Message-Id: <slrn7qcot4.rb1.abigail@alexandra.delanet.com>

Michael Wang (mwang@tech.cicg.ml.com) wrote on MMCLXII September MCMXCIII
in <URL:news:7o55fd$bee$1@news.ml.com>:
"" what pod2man does:
"" 
""      bless REF,CLASSNAME
""  
""      bless REF
"" 
"" what I want pod2man to do:
"" 
""      bless REF,CLASSNAME
""      bless REF
"" 
"" 
"" Any ideas? Thanks.


Uhm, pod2man doesn't do that. pod2man generates *roff. Only after formatting
the *roff, you might get what you are seeing.

If you want to change it, learn *roff; then try to understand pod2man. 
Learning *roff is the easier of the tasks.


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 03 Aug 1999 03:45:09 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: pod2man question
Message-Id: <9Btp3.125$8W1.7259@nsw.nnrp.telstra.net>

On 2 Aug 1999 22:18:21 GMT,
	Michael Wang <mwang@tech.cicg.ml.com> wrote:
>what pod2man does:

You are not entirely correct here;

What pod2man does:

# man pod2man
[snip]
	pod2man converts its input file containing embedded pod
	directives (see the perlpod manpage) into nroff source
	suitable for viewing with nroff(1) or troff(1) using the
	man(7) macro set.
[snip]

nroff or troff or whatever your system uses produces the text output.
Not pod2man. All you have to do is either change the output of pod2man
to seduce [nt]roff into doing what you want, or adapt the macro sets
that [tn]roff uses to do what you want.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Think of the average person. Half of
Commercial Dynamics Pty. Ltd.       | the people out there are dumber.
NSW, Australia                      | 


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

Date: Tue, 3 Aug 1999 13:06:48 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: qq construct
Message-Id: <MPG.121107c6b7e78cc989bc8@news-server>

rennie@electric-web.com writes ..
>I have some perl code that will print out HTML  using the qq~ and qq!
>constuct. However, when i add javascript to the html portion of the perl
>cgi, the qq~ and qq! doesn't work.

works for me .. of course - I may be expecting it to do something 
different than you're expecting .. but I wouldn't know that because you 
don't tell us what you were expecting or what "doesn't work" means

-- 
 jason - remove all hyphens for email reply -


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

Date: 2 Aug 1999 22:46:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: qq construct
Message-Id: <slrn7qcpfh.rb1.abigail@alexandra.delanet.com>

rennie@electric-web.com (rennie@electric-web.com) wrote on MMCLXIII
September MCMXCIII in <URL:news:37A64D93.D34C03A0@electric-web.com>:
;; I have some perl code that will print out HTML  using the qq~ and qq!
;; constuct. However, when i add javascript to the html portion of the perl
;; cgi, the qq~ and qq! doesn't work. . I checked my perl reference books
;; and could not find a soltution to my simple problem.  Is there another
;; qq(constuct that I could try)

Ah yes. The qq~ and qq! constucts are special cased, and will refuse
to work if they contain any Javascript. The qq@ constuct is even worse!
If that finds any Java *or* Javascript code, it will sneak to your fridge
and eat all the cheese!

;; 
;; here is some of the code
;; --- code begins here -----
;; 
;; 
;; sub product_page_header
;;   {
;; 
;; 
;; 

Interesting. 3 empty lines. I am very glad you put those empty lines
there. Puts the entire program in a different light.

;;   local ($page_title) = @_;
;; 
;; 
;; 

And another 3 empty lines. Keep up the good work!

;;   local ($hidden_fields) = &make_hidden_fields;
;; 
;; 
;; 

Cool! How unexpected! More empty lines!

;;   print qq~

[ 157 lines of pointless data (with very odd HTML comments) and empty
  lines deleted ]

;;   ~;


And, care to explain what "doesn't work" means?



Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 2 Aug 1999 22:19:04 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Quoting Strategies and the Jeopardy Game
Message-Id: <slrn7qcns5.rb1.abigail@alexandra.delanet.com>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLXIII September
MCMXCIII in <URL:news:37a633ad@cs.colorado.edu>:
-- The following message will be posted periodically until observed
-- clue-levels in these parts improve, or until the heat death of the
-- Universe arrives.


Arg. Could you please stick to one Subject: and keep it that way?

Else I just have to killfile on one the remaining headers that does
remain unchanged.



Abigail
-- 
sub camel (^#87=i@J&&&#]u'^^s]#'#={123{#}7890t[0.9]9@+*`"'***}A&&&}n2o}00}t324i;
h[{e **###{r{+P={**{e^^^#'#i@{r'^=^{l+{#}H***i[0.9]&@a5`"':&^;&^,*&^$43##@@####;
c}^^^&&&k}&&&}#=e*****[]}'r####'`=437*{#};::'1[0.9]2@43`"'*#==[[.{{],,,1278@#@);
print+((($llama=prototype'camel')=~y|+{#}$=^*&[0-9]i@:;`"',.| |d)&&$llama."\n");


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 2 Aug 1999 21:41:16 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Quoting Strategies and the Jeopardy Game
Message-Id: <37a664dc@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, abigail@delanet.com writes:
:Arg. Could you please stick to one Subject: and keep it that way?

Yes.  What's there now is as it shall be in the cronjob.

--tom
-- 
    There is, however, a strange, musty smell in the air that reminds me of
    something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
        --Larry Wall in Configure from the perl distribution


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

Date: Mon, 2 Aug 1999 23:48:38 -0500
From: "Steve" <itc@cloudnet.com>
Subject: Reading group of files as One ?
Message-Id: <nxup3.70$H_3.7861@ptah.visi.com>

I tried

open(RES, " *.res") or die "Can't open results: $!/n";

to read all files ending with .res
Obviously this did not work.

Is there anyway I can avoid hardcoding the file names in the
program and also avoid manually cycling through each
file ?

Thank you
Steve
itc@cloudnet.com





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

Date: Tue, 03 Aug 1999 04:40:17 +0100
From: Paul Reid <paulreid@cableinet.co.uk>
Subject: Re: Running scrips on own pc
Message-Id: <37A664A0.EB0B6C1A@cableinet.co.uk>

Ok lads bear with me I dont think i'm as up to speed as you guys on this.
I just installed activeperl so now i don't know what to do with it, I,ve tried
typing allsorts into that perl console and i can get scripts to run for a
split second and it goes so fast i dont see it. So I am really keen to set up
a server . I've tried a few servers to see the difference and they are all
messing with my sound(that'll be another issue i guess).
So if i want to set up Pws to run cgi/perl scripts
a) What do i add to the registry and how do i do it?
b)What was the last paragraph about configureing the cgi dir and the three
screen wizard
c)what do i then put instead of  #!usr/bin/perl at the top of my scripts
Any help appreciated cos I was getting right into perl and i am on a bit of a
downer about it now because I cant get this sorted out.
ta



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

Date: Tue, 3 Aug 1999 14:14:34 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: Running scrips on own pc
Message-Id: <MPG.121117b41393aeb4989bcb@news-server>

Paul Reid writes ..
>I just installed activeperl so now i don't know what to do with it...

stop right there .. the very next step is to read the documentation .. 
let's imagine (actually it's a fairly safe guess) that you've installed 
your perl into the following directory

  C:\Program Files\ActivePerl\

this will mean that the documentation that you want will be in the 
following directory

  C:\Program Files\ActivePerl\Html\

so .. open up Windows Explorer .. and navigate to that directory and then 
double click the file called index.html

then start reading .. come back when you've finished

>a) What do i add to the registry and how do i do it?

as well as the ActiveState documentation - see also the Microsoft 
Knowledge Base page

  http://support.microsoft.com/support/kb/articles/Q150/6/29.asp

which gives details on what to add

>b)What was the last paragraph about configureing the cgi dir and the three
>screen wizard

this may not be necessary .. reading the PWS documentation will help you 
there .. and the ActiveState documentation tells you what part of it to 
read

>c)what do i then put instead of  #!usr/bin/perl at the top of my scripts

you put

#!perl -w

at the top of ALL your scripts .. this is (shh everyone) essential for 
your script to work properly

>Any help appreciated cos I was getting right into perl and i am on a bit of a
>downer about it now because I cant get this sorted out.

the documentation is your friend

-- 
 jason - remove all hyphens for email reply -


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

Date: Tue, 03 Aug 1999 05:46:46 +0100
From: Paul Reid <paulreid@cableinet.co.uk>
Subject: Re: Running scrips on own pc
Message-Id: <37A67436.23006DA0@cableinet.co.uk>

My Activeperl installed to C:\Perl and I have a shortcut to the documentation on
the start menu. Which I have been trying to understand.
Whats with the shh everybody? What am i missing?





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

Date: 2 Aug 1999 23:06:07 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Sorting array of hashs by a key
Message-Id: <slrn7qcqkd.rb1.abigail@alexandra.delanet.com>

macarthy@my-deja.com (macarthy@my-deja.com) wrote on MMCLXIII September
MCMXCIII in <URL:news:7o5euo$hkf$1@nnrp1.deja.com>:
-- HI there,
--
-- I'm trying to sort an array of hashes such as:
--
-- I want to sort by age , how do I do this????


RTFFAQ.


Abigail
-- 
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Tue, 03 Aug 1999 00:55:31 -0400
From: brian@pm.org (brian d foy)
Subject: Re: White Camel Awards
Message-Id: <brian-0308990055360001@1cust75.tnt1.durham.nc.da.uu.net>

In article <37A630F9.26AF9893@amdahl.com>, Hal Mounce
<hal_mounce@amdahl.com> wrote:

>I stumbled across http://www.perl.com/pace/pub/whitecamel/newindex.html
>and was about to nominate someone when I noticed the blank for
>"Company:" on the form.
>
>Is this a legitimate award or just a scam to collect marketing data?

i'm not collecting marketing data.  

i'm throwing the information away after friday.

next year i'll include a privacy policy statement.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Tue, 03 Aug 1999 03:28:26 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Whitespace
Message-Id: <ultp3.121$8W1.7259@nsw.nnrp.telstra.net>

On Tue, 03 Aug 1999 02:53:27 GMT,
	Joan Richards <richj@home.com> wrote:
>At a prompt in my script, I don't want the user to be able to type in an
>input that contains more than one word.  Now this word can be comprised
>of upper/lower case letters and number, but nothing else.  So, foobar is
>valid, but foo bar is invalid.  So is "foobar" is invalid.

You can find all this in the documentation that comes with perl.

# perldoc perlre

Please read it. Do not post again until you have read it.

/^[a-zA-Z1-9]+$/

! /[\W_]/

>Now, the user can type in anything they want, however, I want to give
>them the finger if they input something bad.

give_finger() if /^[a-zA-Z1-9]+$/;

or

give_finger() unless /[\W_]/;

Enough of this. Next time you read the manual, try a few things, and
only post when you still can;t work it out. ok?

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | 
Commercial Dynamics Pty. Ltd.       | What's another word for Thesaurus?
NSW, Australia                      | 


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

Date: 3 Aug 1999 03:55:20 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Why no Perl books at Fry's?
Message-Id: <7o5p78$mvp@dfw-ixnews7.ix.netcom.com>

CGI (PerlCoder@Unix.com) wrote:
: 
: I went to Fry's Electronics. They have a large selection of computer
: books, bigger than places like Crown and Barnes & Noble. I saw lots of
: books on Java, C++, HTML, MCSE, etc. but I couldn't find anything on
: Perl. So how should one interpret this situation? Does it mean people
: are unaware of the importance of Perl? Isn't Perl more widely used and
: more important for web sites than Java? Or is Perl used less than I
: thought? Why so many books on Java? Java is so slow and such a

Some bookstores, due to cluelessness, stock Perl books in their Web 
design sections rather than their programming language sections.  Is it 
possible you just missed them?

The reason there are so many Java books out there is that Java is very
heavily hyped and lots of publishers are trying to cash in.  While there
are some good Java books out there, too many Java books consist mostly of
typeset versions of the machine-readable documentation that comes with
Sun's Java classes.  Unfortunately, there are now a bunch of Perl books
that are no better.




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

Date: Tue, 3 Aug 1999 04:12:17 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Why no Perl books at Fry's?
Message-Id: <FFvFoH.H7I@presby.edu>

 CGI <PerlCoder@Unix.com> wrote:
>
>I went to Fry's Electronics. They have a large selection of computer
>books, bigger than places like Crown and Barnes & Noble. I saw lots of
>books on Java, C++, HTML, MCSE, etc. but I couldn't find anything on
>Perl. So how should one interpret this situation? 

Maybe it means that the Perl books are so popular that Fry's can't keep
them in stock!

-- 
Jon Bell <jtbell@presby.edu>                        Presbyterian College
Dept. of Physics and Computer Science        Clinton, South Carolina USA
        [     Information about newsgroups for beginners:     ]            
        [ http://www.geocities.com/ResearchTriangle/Lab/6882/ ]


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

Date: Tue, 03 Aug 1999 03:46:07 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: Windows recursive copy?
Message-Id: <37a6622f.136445470@news.rmi.net>

On Mon, 02 Aug 1999 23:47:50 GMT, tsackett@iname.com wrote:

>I can't imagine this question hasn't been covered before, but I haven't
>been able to track down any useful information.
>
>I'm writing a script that will run on Win95 and WinNT4 machines. It
>needs to copy a directory from a server to a local machine. Is there a
>perl function that will let me do this?
>
>I gather that I could use the DOS function xcopy, but my some
>of my directory paths use "/" (forward-slash) as seperators, and I'd
>rather not have to mess with these just to make a copy.
>
>So, does anyone know the best way to do a recursive copy in Perl for
>Windows?

This (excerpt, may need some use strict and my() statements) might do
it.

====================

use File::Copy;
use File::Basename;
use File::Path;

print ("Copying mirror of $srcDir to $destDir...\n");

GetTreeFiles($srcDir, \@src);
GetTreeFiles($destDir, \@dest);

foreach $s (@src)     {
      $t = $s;
      $t =~ s/\A\Q$srcDir//;
      $rel_src{$s} = $t;
}
foreach $s (@dest)     {
      $t =  $s;
      $t =~ s/\A\Q$destDir//;
      $rel_dest{$t} = $s;
}
while ( ($key, $value) = each(%rel_src) )      {
      $s = $rel_dest{$value};
      next if ( $s && $key && -e $s && -e $key && ((-s $s) == (-s
$key)) );
      $s ||= $destDir . $value;
      print ("Mirroring $key to $s\n");
      fullcopy ($key, $s);
}
print ("At ",  scalar localtime, " $dcount directories made, $count
files copied.\n");

sub fullcopy
{
  my($src) = shift;
  my($dest) = shift;
  my($path);

  $path = dirname($dest);
  if (! -d $path )
  {
    mkpath($path) || die "Can't make path $path: $!\n";
    ++$dcount;
  }
  copy ($src, $dest);  
  ++$count;
}

sub GetTreeFiles
{
  my($rootDir) = shift;
  my($ref) = shift;
  my(@searchdirs) = ();
  my $s;
 
  opendir(DIRHANDLE, $rootDir);
  my(@dirFiles) = readdir(DIRHANDLE);
  foreach $s (@dirFiles)
  {
    next if ($s eq "." || $s eq "..");
    $s = $rootDir . "/" . $s;
    if(-d $s)
    {
      # directory, so add to a list of them to search.
      push(@searchdirs, $s);
    }
    else
    {
        push(@{$ref}, $s);
    }
  }
  # recurse to add more files with each subdirectory found.
  foreach $s (@searchdirs)
  {
    GetTreeFiles($s, $ref);
  }
}


>
>-Tom Sackett
> tsackett@adobe.com
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.

---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.


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

Date: Tue, 03 Aug 1999 03:07:38 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Working Telnet Script Needed
Message-Id: <_1tp3.112$8W1.7259@nsw.nnrp.telstra.net>

[Please fix your linewrap and quoting style]

On Mon, 02 Aug 1999 19:52:29 -0400,
	HC <carvdawg@patriot.net> wrote:
>> > Does anyone have a pointer, or code, for the following?  What I need is any
>> > *working* Perl script that simply works from a NT command prompt, logs into
>> > a variety of UNIX servers (one at a time or multiple boxes), issues commands
>> > (e.g. 'uname -a'), captures that data to a local disk, and logs off.
>>
>> If you're looking for a script, rather than writing one yourself,
>> then you may be in the wrong place.  You will probably have much
>> better luck searching the web using one of the major search
>> engines like Lycos or Alta Vista.  Just be sure to include all
>> the keywords you want, so you don't get too many useless hits.
>
>Wow, Dave!  You don't have anything to contribute, so you hammer the guy!

Dave was right.

>If I had the code to do this, I would make it available...in fact, I
>am working on such a project right now...telnetting to Un*x boxes
>from NT.  I have example of other snippets of code that I have made
>freely available.

Doesn't Net::Telnet work on NT boxes? Activestate's ppm thingy says
it's available.

Martien
-- 
Martien Verbruggen                  | 
Interactive Media Division          | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd.       | excuse - Lazarus Long
NSW, Australia                      | 


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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


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