[15781] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3194 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 29 09:05:29 2000

Date: Mon, 29 May 2000 06:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <959605512-v9-i3194@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 29 May 2000     Volume: 9 Number: 3194

Today's topics:
    Re: Algorythm needed for copying subdirectory hierarchi <dave@dave.org.uk>
    Re: Algorythm needed for copying subdirectory hierarchi <makau@multimania.com>
    Re: Algorythm needed for copying subdirectory hierarchi <thunderbear@bigfoot.com>
    Re: Algorythm needed for copying subdirectory hierarchi <makau@multimania.com>
    Re: alias mail and script perl ghorghor@my-deja.com
    Re: alias mail and script perl <billy@arnis-bsl.com>
    Re: alias mail and script perl ghorghor@my-deja.com
        Calling a perl script from within another perl script <jchajNOjcSPAM@nvcs.freeserve.co.uk.invalid>
    Re: Calling a perl script from within another perl scri <dpowers@cc.gatech.edu>
    Re: cgi error (database)` <gellyfish@gellyfish.com>
    Re: cgi script that lets users post movie and book revi <bitbucket@home.net>
    Re: cgi script that lets users post movie and book revi calderas@my-deja.com
        how to set the filename when sending content of unknown (M. van den Bos)
        NET::FTP <mharriss@callnet0800.com>
    Re: NET::FTP <dave@dave.org.uk>
    Re: newsgroup archives <gellyfish@gellyfish.com>
    Re: Parsing <gellyfish@gellyfish.com>
        Perl and HTML output <vivekvp@spliced.com>
    Re: Perl and HTML output <dave@dave.org.uk>
    Re: Perl constantly-running <billy@arnis-bsl.com>
    Re: Perl date formatting <sue@pennine.com>
        Perl related humor? yuri_leikind@my-deja.com
    Re: Perl script doesn't run <you.will.always.find.him.in.the.kitchen@parties>
    Re: Perl script doesn't run <sue@pennine.com>
    Re: seeking method to encode email addresses in web pag <thunderbear@bigfoot.com>
    Re: Waxing Philosophical <ryanc@nci1.net>
    Re: Waxing Philosophical (Neil Kandalgaonkar)
    Re: Waxing Philosophical (jason)
        Webclient for autofilling html forms fredrik_eriksson@nai.com
    Re: Weird script behaviour called from a web page. (Thaddeus L. Olczyk)
    Re: Weird script behaviour called from a web page. (Thaddeus L. Olczyk)
    Re: What is the @INC ??? <gellyfish@gellyfish.com>
    Re: What package does "xsubpp" belong to and where are  <gellyfish@gellyfish.com>
    Re: Where to Start + FIFO Stack <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 29 May 2000 11:05:56 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Algorythm needed for copying subdirectory hierarchies
Message-Id: <i6g4js82cln2aveuopilpp3v9nj74j6o5j@4ax.com>

On Mon, 29 May 2000 09:41:45 GMT, Makau Divangamene
<makau@multimania.com> wrote:

>I have a subdirectories hierarchy that is so deep that doing a "cp -R"
>for a recursive copy doesn't work. Indeed The directory tree is so
>complex it can't fit into memory so I always get an "OUT OF MEMORY"
>error. This is very crictical because it is for backup purposes ....
>
>So what I want to do is write an algorythm (using Perl) that will copy
>the hole directory tree with all its files (recursively) by doing -
>basically - a "cd <src/dir>; md <dest/dir>, cp * <dest/dir>, etc ..."
>
>For example with the following directory tree :
>/
> dir1
>     dir2
>         dir3
>     dir4
> dir5
>
>It should do :
>cd dir1
>mkdir <dest/dir1>
>cp * <dest/dir1>
>cd dir2
>mkdir <dest/dir1/dir2>
>cp * <dest/dir1/dir2>
>cd dir3
>mkdir <dest/dir1/dir2/dir3>
>cp * <dest/dir1/dir2/dir3>
>cd ..
>cd dir4
>mkdir <dest/dir1/dir4>
>cp * <dest/dir1/dir4>
>cd ..
>cd dir5
>mkdir <dest/dir5>
>cp * <dest/dir5>
>
>( that way I wouldn't get an Out Of Memory Error message )
>
>It looks quite easy in the first approach. That's what I thought but as
>soon as I started coding, I got into the troubles of local variables
>("my"/"local") in "foreach" loops, etc .. And this algorythm is _really_
>not easy to do. Actually it's a real challenge for me. Unfortunately I
>have to find the solution ....
>
>Hoping someone will be kind enough to help me solve the problem,

Did you look at the File::Find modules - it's part of the standard
Perl distribution and is very useful in situations like this.

Cheers,

Dave...

-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>

"There ain't half been some clever bastards" - Ian Dury [RIP]


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

Date: Mon, 29 May 2000 10:50:24 GMT
From: Makau Divangamene <makau@multimania.com>
Subject: Re: Algorythm needed for copying subdirectory hierarchies
Message-Id: <8gti1e$74a$1@nnrp1.deja.com>


> Did you look at the File::Find modules - it's part of the standard
> Perl distribution and is very useful in situations like this.

I've done a perldoc File::Find but this module doesn't seem to be too
documented ... :(


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


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

Date: Mon, 29 May 2000 13:04:47 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: Algorythm needed for copying subdirectory hierarchies
Message-Id: <39324ECF.E391F0FE@bigfoot.com>

Makau Divangamene wrote:
> 
> I have a subdirectories hierarchy that is so deep that doing a "cp -R"
> for a recursive copy doesn't work. Indeed The directory tree is so
> complex it can't fit into memory so I always get an "OUT OF MEMORY"
> error. This is very crictical because it is for backup purposes ....

Have you tried with

	"tar cf - source-dir | (cd dest-dir ; tar xfBpf -)

?
-- 
  Thorbjørn Ravn Andersen         "...plus...Tubular Bells!"
  http://bigfoot.com/~thunderbear


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

Date: Mon, 29 May 2000 12:09:58 GMT
From: Makau Divangamene <makau@multimania.com>
Subject: Re: Algorythm needed for copying subdirectory hierarchies
Message-Id: <8gtmmg$a22$1@nnrp1.deja.com>


> 	"tar cf - source-dir | (cd dest-dir ; tar xfBpf -)

I typed litterally what you wrote:
tar cf - source-dir | (cd dest-dir ; tar xfBpf -)

(I replaced "source-dir" by the name of my source directory and
"dest-dir" by the destination one)

but tar returned the following error message :
-
tar: Old option `f' requires an argument.
Try `tar --help' for more information.
Broken pipe
-

Could you give the correct syntax, with an example (if possible)?

Thanks for your help!


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


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

Date: Mon, 29 May 2000 10:13:40 GMT
From: ghorghor@my-deja.com
Subject: Re: alias mail and script perl
Message-Id: <8gtfsd$5n6$1@nnrp1.deja.com>

now i don't recieve email error

so i think the mail is transmitted to the script

but the script doesn't start because he generate a file
and the file isn't generated

is someone could help me
here is the code of the script :
#!/usr/local/bin/perl

open(fic,">tutu.txt");
print fic "essai reception du message";
close(fic);


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


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

Date: Mon, 29 May 2000 10:39:01 GMT
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: alias mail and script perl
Message-Id: <8gthc4$6gp$1@nnrp1.deja.com>

In article <8gtfsd$5n6$1@nnrp1.deja.com>,
  ghorghor@my-deja.com wrote:
> now i don't recieve email error
>
> so i think the mail is transmitted to the script
>
> but the script doesn't start because he generate a file
> and the file isn't generated
>
> is someone could help me
> here is the code of the script :
> #!/usr/local/bin/perl

#!/usr/bin/perl -w

>
> open(fic,">tutu.txt");

First, you *always* should check return value from system calls:

open FIC, '>tutu.txt'   or die "cannot open tutu.txt: $!\n";

IMHO you don't get the file created because you try to create it in the
script's 'current working directory'. But you cannot be sure what it is when
your script is started by sendmail. So you end up trying to create a file in
an unknown-to-you directory, maybe having insufficient permissions.

Solution - use the full path like '/path/to/tutu.txt' when you open() it.

BTW, check your '/' (root) directory (or better use find), maybe you have
actually created the file but in an unexpected place.

Hope this helps.
Ilja.


> print fic "essai reception du message";
> close(fic);
>



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


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

Date: Mon, 29 May 2000 12:33:36 GMT
From: ghorghor@my-deja.com
Subject: Re: alias mail and script perl
Message-Id: <8gto30$ask$1@nnrp1.deja.com>



thanks for this precision
in fact i specified the path and it work.

i have an other problem
the mail is transmitted to the script by STDIN
the script is lanch through sendmail
so how i could read the mail

is @tub=<STDIN>
work

or is it a better solution
thx


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


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

Date: Mon, 29 May 2000 05:12:10 -0700
From: John Chajecki <jchajNOjcSPAM@nvcs.freeserve.co.uk.invalid>
Subject: Calling a perl script from within another perl script
Message-Id: <1edc9a9a.19187c57@usw-ex0106-045.remarq.com>

Hi,

I am trying to create an installer which need to update/install
several software components. Each component has its own
install.pl script. To consolidat this together, I am trying to
write a global install script that can call each of the
individual install.pl's for each software component, something
like:

if ($installflag1) {call install1.pl};
if ($installflag2) {call install2.pl};
if ($installflag3) {call install3.pl};

I have scanned the printed manuals I have and the HTML perl
documentation supplied with the distribution of ActivePerl 5.005
however, nowhere do I find information on how to call on perl
script from another.

I eventually found some info on this forum and have tried the
following:

system("/perl/bin/perl.exe /subdir/subdir/install.pl");

which seems to work, however, I understand that the following is
the 'preferred' or more efficient method:

either: `./subdir/subdir/install.pl'`;
or `/perl/bin/perl.exe ./subdir/subdir/install.pl`;
or: qx{/subdir/subdir/install.pl};
or: qx{/perl/bin/perl.exe /subdir/subdir/install.pl};

These methods do not produce and screen output nor error
messages so I do not know what is going on.

I have also tried variants like:

@reponse = `./subdir/subdir/install.pl 2>&1';

but this alo gives no output on the screen. Can someone tell me
what I am doing wrong with the second two options and wether
there is any merit in persevering with them?



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



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

Date: Mon, 29 May 2000 08:48:53 -0400
From: "Doug Powers" <dpowers@cc.gatech.edu>
Subject: Re: Calling a perl script from within another perl script
Message-Id: <8gtorr$5r1$1@news-int.gatech.edu>

> I have also tried variants like:
>
> @reponse = `./subdir/subdir/install.pl 2>&1';


do

@response = qx`./subdir/subdir/install p1 2>&1`;
print @response;


--
----------------------------------------
Doug Powers
CS1312, TA/PrgDev
Georgia Institute of Technology
http://doug.resnet.gatech.edu
dpowers@cc.gatech.edu
----------------------------------------
"John Chajecki" <jchajNOjcSPAM@nvcs.freeserve.co.uk.invalid> wrote in
message news:1edc9a9a.19187c57@usw-ex0106-045.remarq.com...
> Hi,
>
> I am trying to create an installer which need to update/install
> several software components. Each component has its own
> install.pl script. To consolidat this together, I am trying to
> write a global install script that can call each of the
> individual install.pl's for each software component, something
> like:
>
> if ($installflag1) {call install1.pl};
> if ($installflag2) {call install2.pl};
> if ($installflag3) {call install3.pl};
>
> I have scanned the printed manuals I have and the HTML perl
> documentation supplied with the distribution of ActivePerl 5.005
> however, nowhere do I find information on how to call on perl
> script from another.
>
> I eventually found some info on this forum and have tried the
> following:
>
> system("/perl/bin/perl.exe /subdir/subdir/install.pl");
>
> which seems to work, however, I understand that the following is
> the 'preferred' or more efficient method:
>
> either: `./subdir/subdir/install.pl'`;
> or `/perl/bin/perl.exe ./subdir/subdir/install.pl`;
> or: qx{/subdir/subdir/install.pl};
> or: qx{/perl/bin/perl.exe /subdir/subdir/install.pl};
>
> These methods do not produce and screen output nor error
> messages so I do not know what is going on.
>
> I have also tried variants like:
>
> @reponse = `./subdir/subdir/install.pl 2>&1';
>
> but this alo gives no output on the screen. Can someone tell me
> what I am doing wrong with the second two options and wether
> there is any merit in persevering with them?
>
>
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
> The fastest and easiest way to search and participate in Usenet - Free!
>




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

Date: 28 May 2000 12:04:29 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: cgi error (database)`
Message-Id: <8gquft$ra1$1@orpheus.gellyfish.com>

On Thu, 25 May 2000 21:26:09 GMT vikas_jain@planetall.com wrote:
> Hi,
> 
> I had written a small perl script to connect to Sybase database using
> DBI calls.
> I am getting the following error (logged in the error_log file of web
> server), but the same script run without any problems on command prompt.
> I would appreciate if someone can throw some light on it.
> 
> install_driver(Sybase) failed: Can't load
> '/apps/perl/lib/site_perl/sun4-solaris/auto/DBD/Sybase/Sybase.so' for
> module DBD::Sybase: ld.so.1: /apps/perl/bin/perl: fatal: libct.so: open
> failed: No such file or directory at
> /apps/perl/lib/sun4-solaris/5.00404/DynaLoader.pm line 166.
> 
>  at (eval 22) line 2
> 
>     DBI::install_driver('DBI', 'Sybase') called at
> /apps/perl/lib/site_perl/DBI.pm line 348
>     DBI::connect('DBI', 'MIGRATE11', 'refdb', 'baseball10', 'Sybase')
> called at /home/vijain/apache_1.3.9/cgi-bin/test line 30
> 

I would take a guess that due to the differences in thee environment when
running as a CGI program the Sybase libraries are not being supplied with
the information they require to find some required component.  You will
need to arrange to have the appropriate environment variables set for
your HTTP spawned processes - most HTTP servers have some facilities for
doing this and you should refer to the documentation for your server or ask
in comp.infosystems.www.servers.unix .

Alternatively if your system has an /etc/ld.so.conf you can add the
appropriate path(s) to it and run ldconfig - if you dont know what the
appropriate paths(s) are you would probably be best asking in some sybase
group.

/J\
-- 
Now what is a wedding? Well, Webster's dictionary describes a wedding
as the process of removing weeds from one's garden.
-- 
fortune oscar homer


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

Date: Mon, 29 May 2000 11:51:27 GMT
From: <bitbucket@home.net>
Subject: Re: cgi script that lets users post movie and book reviews on website?
Message-Id: <3RsY4.19188$a36.308870@news1.rdc1.fl.home.com>

<calderas@my-deja.com> wrote in message news:8gtaet$2ap$1@nnrp1.deja.com...
> I am looking for a free cgi script that lets users post reviews of
> things (books, movies) on a website... maybe one that lets the user
> write a paragraph review and give a 1-10 rating for instance... anyone
> know a good one that will do this?
>
>
http://www.cgi-resources.com/
It's usually called a guestbook script.

--
McWebber
No email replies read.
Free Domain Name Parking
http://www.4sarasota.com/registration.html





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

Date: Mon, 29 May 2000 12:33:36 GMT
From: calderas@my-deja.com
Subject: Re: cgi script that lets users post movie and book reviews on website?
Message-Id: <8gto30$asj$1@nnrp1.deja.com>

yeah, and i couldnt find exactly what i was looking for there... there
are polling scripts but none that seemed to allow for ratings,
comments, and calculating the ratings...


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


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

Date: Mon, 29 May 2000 10:58:50 GMT
From: mvdbos@integral.nl (M. van den Bos)
Subject: how to set the filename when sending content of unknown type to a browser?
Message-Id: <39324c29.10121796@news.nl.net>

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

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

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

--
Matthijs van den Bos     INTEGRAL Knowledge Utilization BV
mvdbos@integral.nl       www.integral.nl


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

Date: Mon, 29 May 2000 12:13:18 +0100
From: "martin               harriss" <mharriss@callnet0800.com>
Subject: NET::FTP
Message-Id: <393251fb@eeyore.callnetuk.com>

This is probably a general question on the use of modules.  I am running an
Apache server on my own machine, and I have Active Perl installed and I want
to use NET::FTP

I use the syntax as described in the documentation:

use Net::FTP;


    $ftp = Net::FTP->new("some.host.name", Debug => 0);
    $ftp->login("anonymous",'me@here.there');
    $ftp->cwd("/pub");
    $ftp->get("that.file");
    $ftp->quit;

but I get the error:

Can't locate Net/FTP.pm in @INC (@INC contains: C:/Perl/lib
C:/Perl/site/lib )

So I find the location of ftp.pm, and include this in @inc:

use lib "C:/Perl/Site/lib/Uri";
use FTP;


    $ftp = FTP->new("some.host.name", Debug => 0);
    $ftp->login("anonymous",'me@here.there');
    $ftp->cwd("/pub");
    $ftp->get("that.file");
    $ftp->quit;

and I then get

Can't locate object method "new" via package "FTP"

My question is, how do I address the package properly so I works as
documented?

Martin Harriss
Cambridge UK
martin.harriss@iname.com




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

Date: Mon, 29 May 2000 12:22:26 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: NET::FTP
Message-Id: <pgk4jskl82enclkm5tbud7uua3npq51rjf@4ax.com>

On Mon, 29 May 2000 12:13:18 +0100, "martin               harriss"
<mharriss@callnet0800.com> wrote:

>This is probably a general question on the use of modules.  I am running an
>Apache server on my own machine, and I have Active Perl installed and I want
>to use NET::FTP
>
>I use the syntax as described in the documentation:
>
>use Net::FTP;
>
>
>    $ftp = Net::FTP->new("some.host.name", Debug => 0);
>    $ftp->login("anonymous",'me@here.there');
>    $ftp->cwd("/pub");
>    $ftp->get("that.file");
>    $ftp->quit;
>
>but I get the error:
>
>Can't locate Net/FTP.pm in @INC (@INC contains: C:/Perl/lib
>C:/Perl/site/lib )
>
>So I find the location of ftp.pm, and include this in @inc:
>
>use lib "C:/Perl/Site/lib/Uri";
>use FTP;
>
>
>    $ftp = FTP->new("some.host.name", Debug => 0);
>    $ftp->login("anonymous",'me@here.there');
>    $ftp->cwd("/pub");
>    $ftp->get("that.file");
>    $ftp->quit;
>
>and I then get
>
>Can't locate object method "new" via package "FTP"
>
>My question is, how do I address the package properly so I works as
>documented?

What you've found there is the URI::FTP module - not the Net::FTP
module - which seems not to be installed on your PC. You can install
it by installing the 'libnet' package using PPM. You'll then find that
you'll have C:/Perl/Site/lib/Net/FTP.pm and you won't need you 'use
lib' line.

hth,

Dave...

-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>

"There ain't half been some clever bastards" - Ian Dury [RIP]


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

Date: 28 May 2000 12:09:28 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: newsgroup archives
Message-Id: <8gqup8$s8j$1@orpheus.gellyfish.com>

On Thu, 25 May 2000 16:28:49 -0700 Larry Rosler wrote:
> In article <392DA26F.31093EBA@stomp.stomp.tokyo> on Thu, 25 May 2000 
> 15:00:15 -0700, Godzilla! <godzilla@stomp.stomp.tokyo> says...
>> Eli Mansour wrote:
>>  
>> > Is there archives for this newsgroup.
>> 
>> Deja Vu is a fairly decent source for
>> archived articles:
>> 
>> http://www.dejanews.com/
> 
> ...
> 
>> ... Anyhow,
>> upper right, funny looking arrow thing
>> which is a hot link. This will direct
>> you into their search facility.
> 
> This will do it faster.  I bookmarked it, because who can remember?  :-)
> 
>   http://www.deja.com/home_ps.shtml

It appears that at the moment anything older than a couple of weeks is not
available although a note somewhere on the site indicates this is only
temporary - in the interim I could send the 23719 articles that I have on
this machine I suppose ;-}

/J\
-- 
You can't keep blaming yourself. Just blame yourself once, and move on.
-- 
fortune oscar homer


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

Date: 29 May 2000 10:09:22 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Parsing
Message-Id: <8gtc42$ptl$1@orpheus.gellyfish.com>

On Sat, 27 May 2000 22:17:20 GMT Jack wrote:
> I cannot seem to figure out how to parse this FTP listing:
> 
> -rwx------   1 user     group     3616310 Aug 30  1998 Alexia - Number
> one.zip
> drwx------   1 user     group           0 Apr 18 00:15 Alice Doc.doc
> 
> 
> In the meantime, I've parsed other FTP listing through this code
> snippet:
> 
> ($pr, $fs, $us, $gr, $sz, $d1, $d2, $d3, $fn) = split / +/, $Entry;
> 
> but as you can see, the $fn (filename) will only store Alexia, not the
> full, Alexia - Number one.zip. Can some help me out with this?

I would recommend that you eschew the split and use unpack instead :


#!/usr/bin/perl -w

use strict;

while(<DATA>)
{
  chomp;
  my ($pr, 
      $fs, 
      $us, 
      $gr, 
      $sz, 
      $d1, 
      $d2, 
      $d3, 
      $fn) = unpack 'A11A4A9A9A9A13A*',$_ ;

  print join '*',($pr, $fs, $us, $gr, $sz, $d1, $d2, $d3, $fn) ;
}
__END__
-rwx------   1 user     group     3616310 Aug 30  1998 Alexia - Number one.zip
drwx------   1 user     group           0 Apr 18 00:15 Alice Doc.doc

/J\
-- 
Beer. Now there's a temporary solution.
-- 
fortune oscar homer


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

Date: Mon, 29 May 2000 10:32:08 GMT
From: vivekvp <vivekvp@spliced.com>
Subject: Perl and HTML output
Message-Id: <8gtgv8$6e9$1@nnrp1.deja.com>



Hello,

I have some output given to me in a feed in the format:

"ID,00/05/29,1,2,3,4,5,a,b,c,d,e"

I need to extract the data so the fields ID and date are printed out,
then the numbers are listed as a hyperlink to the corresponding letter
- and they output on a web page.:

ie.

ID
date
1 - links to page 'a'
2 - links to page 'b'
3 - links to page 'c'
4 - links to page 'd'
5 - links to page 'e'

The data should always be coming in as an ID,date, 12 numbers, 12
coresponding responses.

Any help?

Thanks

V
--
May your bad hair days be few.  This does not
apply to the bald.


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


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

Date: Mon, 29 May 2000 12:15:06 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: Perl and HTML output
Message-Id: <a7k4jssgnaajjohdtapcci0u96lvjobl9h@4ax.com>

On Mon, 29 May 2000 10:32:08 GMT, vivekvp <vivekvp@spliced.com> wrote:

>
>
>Hello,
>
>I have some output given to me in a feed in the format:
>
>"ID,00/05/29,1,2,3,4,5,a,b,c,d,e"
>
>I need to extract the data so the fields ID and date are printed out,
>then the numbers are listed as a hyperlink to the corresponding letter
>- and they output on a web page.:
>
>ie.
>
>ID
>date
>1 - links to page 'a'
>2 - links to page 'b'
>3 - links to page 'c'
>4 - links to page 'd'
>5 - links to page 'e'
>
>The data should always be coming in as an ID,date, 12 numbers, 12
>coresponding responses.
>
>Any help?

Didn't we do something very similar to this just the other day? Has
someone set it as coursework?

Try something like this:


#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);

print header;
print start_html;

while (<DATA>) {
  chomp;
  my @data = split(/,/);

  my ($id, $date) = splice(@data, 0, 2);
  my $len = @data/2;

  print p($id, br, $date);

  print ul(li([map { a({-href=>$data[$_+$len]},
                       $data[$_]) } 0 .. $len - 1 ]));
}

__END__
ID,00/05/29,1,2,3,4,5,a,b,c,d,e


hth,

Dave...
-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
yapc::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>

"There ain't half been some clever bastards" - Ian Dury [RIP]


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

Date: Mon, 29 May 2000 09:55:50 GMT
From: Ilja <billy@arnis-bsl.com>
Subject: Re: Perl constantly-running
Message-Id: <8gter3$50e$1@nnrp1.deja.com>

In article <8gstm8$p0h$1@nnrp1.deja.com>,
  mioi@my-deja.com wrote:
> Hi.  I'm new to Perl, and I've always known it to be the type of
> programming language where you run it, it does its job, and it quits.
> but my latest task requires that i have a perl script grabbing a web
> page every 10 seconds or so and storing it onto a file.  all i need to
> know is how i will keep this perl script constantly running and perform
> its task every 10 seconds..  can someone please let me know?  thanks!
>

Why not ?

#!/usr/bin/perl -w

use strict;

while (1)
{

     do_your_job_here();

     sleep(10);

}

# that's all

After you get it worked you may want to make your process run in the
background (daemonize). See FAQ "How do I fork a daemon process?" in your
local 'perldoc perlfaq8' or
http://www.cpan.org/doc/manual/html/pod/perlfaq8.html. Also don't miss
"Background processes" section in 'perldoc perlipc' (or
http://www.cpan.org/doc/manual/html/pod/perlipc.html).

Hope this helps.
Ilja.



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


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

Date: 29 May 2000 03:40:04 -0700
From: Sue Spence <sue@pennine.com>
Subject: Re: Perl date formatting
Message-Id: <8gthe4$1php@drn.newsguy.com>

In article <slrn8j3omq.r39.sjs@john.sympatico.ca>, sjs@yorku.ca says...
>
>Goofzilla! <goofzilla@stomp.stomp.tokyo> wrote:
> [...] or is this just more trolling?
>


I know where I'd place my bet.  



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

Date: Mon, 29 May 2000 12:00:43 GMT
From: yuri_leikind@my-deja.com
Subject: Perl related humor?
Message-Id: <8gtm56$9np$1@nnrp1.deja.com>

Hi All,

Can anyone point me to a collection of Perl related humor?

Thanks!

Yuri Leikind


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


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

Date: Mon, 29 May 2000 23:16:00 +1200
From: "Tintin" <you.will.always.find.him.in.the.kitchen@parties>
Subject: Re: Perl script doesn't run
Message-Id: <959599147.579916@shelley.paradise.net.nz>


<Newbie> wrote in message news:8gt1te010l8@news1.newsguy.com...
>
> I have a simple 'Hello world' script called test.pl that won't run. It's
in the /home/httpd/cgi-bin directory. All directories are owned by root, I'm
logged in as root, and the file permissions on the script are 755. It looks
like:
>
> #!/usr/bin/perl
> print "Hello world\n";
>
> A 'which perl' returns /usr/bin/perl.
>
> If I run it on the command line like 'perl test.pl', it runs fine. If I
run it like './test.pl' or 'test.pl', I get a message that says "bash:
/home/httpd/cgi-bin/test.pl: No such file or directory". I've tried all
sorts of things. I can run shell scripts from the same directory with the
same permissions, etc. What gives?

It's most likely your #! line is not the first line in the file.  If it
isn't then whatever shell you are running at the time will try to interpret
it.




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

Date: 29 May 2000 03:32:32 -0700
From: Sue Spence <sue@pennine.com>
Subject: Re: Perl script doesn't run
Message-Id: <8gth00$1opj@drn.newsguy.com>

In article <8gt1te010l8@news1.newsguy.com>, Newbie says...
>
>
>I have a simple 'Hello world' script called test.pl that won't run. It's in the
>/home/httpd/cgi-bin directory. All directories are owned by root, I'm logged in
>as root, and the file permissions on the script are 755. It looks like:
>
>#!/usr/bin/perl
>print "Hello world\n";
>
>A 'which perl' returns /usr/bin/perl.
>
>If I run it on the command line like 'perl test.pl', it runs fine. If I run it
> like './test.pl' or 'test.pl', I get a message that says 
>"bash: /home/httpd/cgi-bin/test.pl: No such file or directory". 
>I've tried all sorts of things. I can run shell scripts from the same 
>directory with the same permissions, etc. What gives?

The situation you describe is typical of a malformed shebang line.  For
curiosity's sake you could do the following to see exactly what is in that line
of the file:

% od -c test.pl

You might find that an invisible character is lurking in the shebang. 

Or you can just skip all that and re-type the shebang (delete it first). 

E.g.

$ cat test.pl
#!/usr/bin/local/perl -w
print "Hello world.\n";
exit;

$ od -c test.pl
0000000   #   !   /   u   s   r   /   b   i   n   /   l 002   o   c   a
0000020   l   /   p   e   r   l       -   w  \n   p   r   i   n   t    
0000040   "   H   e   l   l   o       w   o   r   l   d   .   \   n   "
0000060   ;  \n   e   x   i   t   ;  \n
0000070



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

Date: Mon, 29 May 2000 12:17:48 +0200
From: =?iso-8859-1?Q?Thorbj=F8rn?= Ravn Andersen <thunderbear@bigfoot.com>
Subject: Re: seeking method to encode email addresses in web page forms
Message-Id: <393243CC.486B8B8@bigfoot.com>

"Godzilla!" wrote:

> year for an exceptionally busy site at
> 274 hits per day. In 30 years, a 15 minute

These guys ship out 40 million ads a day:

http://valueclick.com/about.html

Which code do you think they will use?
-- 
  Thorbjørn Ravn Andersen         "...plus...Tubular Bells!"
  http://bigfoot.com/~thunderbear


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

Date: Mon, 29 May 2000 07:04:59 -0400
From: "Ryan & Treena Carrier" <ryanc@nci1.net>
Subject: Re: Waxing Philosophical
Message-Id: <39324e36_1@news.cybertours.com>

Thank you, those of you who chose to ignore my ignorance. I now have a
better understanding of the differences. For those who chose not to (ignore
my ignorance), I'm not a programming ace trying to be facetious. I am a
(very) beginning Perl student. (self-taught, the worst kind!)

Ryan & Treena Carrier <ryanc@nci1.net> wrote in message
news:3931bcc1_2@news.cybertours.com...
> Being a beginning programmer, please entertain my ignorance:
>
> What is the difference between
>
> while(<INFILE>)  {
> }
>
> and
>
> until(!<INFILE>) {
> }
>
> and
>
> unless(!<INFILE>) {
> }
>
> Are they all the same?
>
>




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

Date: 29 May 2000 11:27:29 GMT
From: nj_kanda@alcor.concordia.ca (Neil Kandalgaonkar)
Subject: Re: Waxing Philosophical
Message-Id: <8gtk71$28n$1@newsflash.concordia.ca>

In article <39324e36_1@news.cybertours.com>,
Ryan & Treena Carrier <ryanc@nci1.net> wrote:
>Thank you, those of you who chose to ignore my ignorance. I now have a
>better understanding of the differences. For those who chose not to (ignore
>my ignorance), I'm not a programming ace trying to be facetious. I am a
>(very) beginning Perl student. (self-taught, the worst kind!)

I think you might have misunderstood -- the complaints of trolling and
such were not directed at you, but at the poster who claimed the three
code snippets had no important differences.

Your question was very astute, IMO. 


-- 
Neil Kandalgaonkar
neil@brevity.org


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

Date: Mon, 29 May 2000 12:10:25 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Waxing Philosophical
Message-Id: <MPG.139cfb53e07e710e9896f1@news>

Ryan & Treena Carrier writes ..
>Thank you, those of you who chose to ignore my ignorance. I now have a
>better understanding of the differences. For those who chose not to (ignore
>my ignorance), I'm not a programming ace trying to be facetious. I am a
>(very) beginning Perl student. (self-taught, the worst kind!)

apparently you're also a beginning usenet user

read the articles in the thread closely - pay attention to who comments 
are actually in response to - no one ignored your ignorance

also .. try to put your reply AFTER the text that you're quoting .. and 
if the text that you're quoting is not relevant then feel free to...

<snip>

-- 
 jason - elephant@squirrelgroup.com -


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

Date: 29 May 2000 12:05:31 GMT
From: fredrik_eriksson@nai.com
Subject: Webclient for autofilling html forms
Message-Id: <8gtmeb01gqk@news1.newsguy.com>


I'm trying to build a simple web client that autofills html forms so I can speed up my use of free SMS sites like www.mtnsms.com. Has anyone built something like that and could give me a hint?

Cheers,

Fredrik

==================================
Posted via http://nodevice.com
Linux Programmer's Site


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

Date: Mon, 29 May 2000 12:05:32 GMT
From: olczyk@interaccess.com (Thaddeus L. Olczyk)
Subject: Re: Weird script behaviour called from a web page.
Message-Id: <39335c71.283412265@nntp.interaccess.com>

On Mon, 29 May 2000 09:57:10 +0000, rh@dragon.internal.gxn.net ()
wrote:

>In article <3930fc42.193253765@nntp.interaccess.com>,
>	olczyk@interaccess.com (Thaddeus L. Olczyk) writes:
>> System: Linux (Mandrake 7.0)
>> Server:Apache 
>[snip]
>> 
>> #!/usr/bin/perl
>> system 'perl fullscript2name',@args
>[snip]
>> I've cut and paste the first line from script1 to script2.
>
>I got caught a few times with cut and paste in X11 where 'invisible'
>characters appear or other nonsense happend. Remove the first line,
>"write" it from scratch and try it again. 
>
>Hope this helps.
Nope but thanks anyway.
I'm an old Fortran/mainframe programmer, so I've seen the invisible
character dodge to many times. I automatically cut and paste to avoid
the problem, then retype two or three times. It is a file that was
originally on a NT box moved to UNIX so there may be some 
'newline' issues. Next step is to use emacs and hexlify to examine the
file.


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

Date: Mon, 29 May 2000 12:57:22 GMT
From: olczyk@interaccess.com (Thaddeus L. Olczyk)
Subject: Re: Weird script behaviour called from a web page.
Message-Id: <39346845.286440281@nntp.interaccess.com>

On Mon, 29 May 2000 03:32:13 GMT, sjs@yorku.ca (Steven Smolinski)
wrote:

>Thaddeus L. Olczyk <olczyk@interaccess.com> wrote:
>>On Sun, 28 May 2000 16:31:06 +0100, Dave Cross <dave@dave.org.uk>
>>wrote:
>
>>>Hope you don't think that I answered without thinking.
>
>> Yeah you did.
>
>Maybe you'd get informed answers if you posted more details, or
>were less of a prick.
>
I keep hoping that it keeps the morons who think they're hotshot
programmers after six months of programming away. 

>If you post the smallest relevant piece of code that you can have
>in script2 while still getting your error, then people can
>help you rule out perl as the problem, rather than the
>environment.  (For ex., does the script run if the second line
>is exit;?  If not, then your problem isn't perl.)
>
Doubt you could help me.


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

Date: 28 May 2000 12:32:03 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: What is the @INC ???
Message-Id: <8gr03j$v9$1@orpheus.gellyfish.com>

On Thu, 25 May 2000 14:58:02 -0400 "Martin C Dore (LMC)" wrote:
> Many times I read, or have this message....So what is @INC.....

It is described in the perlvar manpage along with all of the other
builtin or predefined variables.

/J\
-- 
Oh, that's hot. There isn't a man alive that wouldn't get turned on by
that. Well, g'night.
-- 
fortune oscar homer


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

Date: 28 May 2000 12:26:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: What package does "xsubpp" belong to and where are updates?
Message-Id: <8gqvpm$vju$1@orpheus.gellyfish.com>

In comp.lang.perl.misc Yitzchak Scott-Thoennes <sthoenna@efn.org> wrote:
> In article <XYjX4.93847$hT2.388039@news1.rdc1.ct.home.com>,
> Dan Sugalski <dan@tuatha.sidhe.org> wrote:
> [refering to upgrading xsubpp]
>> It's part and parcel of the main perl distribution. You'll need to upgrade
>> to a more recent version of perl to get it. (It's got far too much
>> dependence on perl's guts to be a drop-in replacement)
> 
> I believe you, but can you explain:
> 
> [D:\perl\lib\5.6.0\ExtUtils]fgrep "require 5." xsubpp
> require 5.002;

This is possibly related to the introduction of prototypes in that release
- you could look in the file Changes5.002 in the source distribution to
come up with your own guess ;-}

/J\
-- 
Ha ha! Look at this country! ?You are gay!? Ha ha!
-- 
fortune oscar homer


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

Date: 28 May 2000 12:19:41 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Where to Start + FIFO Stack
Message-Id: <8gqvcd$u7f$1@orpheus.gellyfish.com>

On Fri, 26 May 2000 13:46:59 GMT Gwyn Judd wrote:
> I was shocked! How could Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
> say such a terrible thing:
>>> 2) How difficult would it be to implement a FIFO stack in Perl (i.e. a
>>> script to accept form input, add the input to the top of the stack, and pop
>>> the last entry)?
>>
>>very simple using perl arrays
>>see these docs
>>perldoc -f shift
>>perldoc -f unshift
> 
> You mean "push" and "shift"

or unshift and pop  ... ;-}

/J\
-- 
No matter how good you are at something, there's always about a million
people better than you.
-- 
fortune oscar homer


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

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


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 3194
**************************************


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