[17497] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4917 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 18 14:05:35 2000

Date: Sat, 18 Nov 2000 11:05:14 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <974574314-v9-i4917@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 18 Nov 2000     Volume: 9 Number: 4917

Today's topics:
    Re: A silly. Substitution - s/// (Anno Siegel)
    Re: Beginners blues. <bart.lateur@skynet.be>
        File Extensions <no-spam-gbat@gbat.screaming.net>
    Re: hash printout <psimdars@lisco.com>
        hello i am new <heh@bbbb.org>
    Re: How do I ensure that only a single instance of my s (Michael Koehne)
    Re: How do I ensure that only a single instance of my s <c.manley@chello.nl>
        How do you execute another process with an immediate re <c.manley@chello.nl>
    Re: How do you execute another process with an immediat <email@address.com>
    Re: How do you execute another process with an immediat (Honza Pazdziora)
        I am sorry for posting this so many times! <johan.ditmar@telia.com>
        Illegal hexadecimal digit '}'?! (Kai Henningsen)
    Re: looking for graphing script (Honza Pazdziora)
    Re: Newbie Rename() Function <tech-removethis-@rch-usa.com>
        print 'Location: <todd@mrnoitall.com>
    Re: print 'Location: <heh@bbbb.org>
    Re: print 'Location: (Honza Pazdziora)
        Problems saving an uploaded file. <johan.ditmar@era.ericsson.se>
        Problems saving an uploaded file. <johan.ditmar@era.ericsson.se>
        Problems saving an uploaded file. <johan.ditmar@era.ericsson.se>
        Problems saving an uploaded file. <johan.ditmar@era.ericsson.se>
        Problems saving an uploaded file. <johan.ditmar@era.ericsson.se>
        Problems saving an uploaded file. <johan.ditmar@era.ericsson.se>
        Problems saving an uploaded file. <johan.ditmar@era.ericsson.se>
        Problems saving an uploaded file. <johan.ditmar@era.ericsson.se>
        Problems saving an uploaded file. <johan.ditmar@era.ericsson.se>
        Problems saving an uploaded file. <johan.ditmar@era.ericsson.se>
    Re: Problems saving an uploaded file. <bart.lateur@skynet.be>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 18 Nov 2000 16:17:51 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: A silly. Substitution - s///
Message-Id: <8v6a3f$m7i$1@lublin.zrz.tu-berlin.de>

Martien Verbruggen <mgjv@tradingpost.com.au> wrote in comp.lang.perl.misc:
>On 16 Nov 2000 19:10:37 -0000,
>	Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:

>>>>Pity.  I thought "s" was for "squeeze", and found that more colorful.
>
>I think that the s was meant to stand for 'squash'...

You're making my world brighter.

Anno


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

Date: Sat, 18 Nov 2000 17:17:43 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Beginners blues.
Message-Id: <g9ed1ts2sa3ej7knjive44nu4tramf3ns1@4ax.com>

John Boy Walton wrote:

>It does not open the file because the file does not exist.
>open BOGUS,"+>>C:\\Progra~1"
>open BOGUS,">>C:\\Progra~1"
>open BOGUS,">C:\\Progra~1"
>All do not create the file.

I think "C:\\Progra~1" is just the short name for 'c:\Program Files',
which is a *directory* on most Win95 and Win98 systems. You cannot
replace a directory with a file by just trying to create a file. Try
using a name that isn't in use just yet.

BTW have you checked what $! says on why it fails? I think you did.

-- 
	Bart.


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

Date: Sat, 18 Nov 2000 16:15:33 -0000
From: "gazzaman" <no-spam-gbat@gbat.screaming.net>
Subject: File Extensions
Message-Id: <3a16aac7@news.server.worldonline.co.uk>

As part of a college project I am creating WEB pages that call and execute
perl scripts.

When I save my perl scrips to cgi-bin with a .pl extension and they won't
run.
I save then to the same directory with a .cgi extension and they do.

What is wrong?
Is it something that I can fix or does the server manager have to do it.

It is an apache server running on a sun (solaris) system.




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

Date: Sat, 18 Nov 2000 08:50:49 -0600
From: paul simdars <psimdars@lisco.com>
Subject: Re: hash printout
Message-Id: <3A169749.7CC53B48@lisco.com>

Bart Lateur wrote:

> paul simdars wrote:
>
> > I have a hash like this  :
> >
> >%hnums = (
> >1,  20,
> >2,  15,
> >3,  40,
> >4,  22 );
> >
> >I have looked thru lots of articles and examples but have not found what
> >I am
> >looking for.  I want to sort them by the values and print the value and
> >the
> >key.   I found a perfect example in a book but it didn't work.
>
>         foreach (sort { $hnums{$a} <=> $hnums{$b} } keys %hnums) {
>             print "$hnums{$_} belongs to $_\n";
>         }
>
> -->
>         15 belongs to 2
>         20 belongs to 1
>         22 belongs to 4
>         40 belongs to 3
>
> --
>         Bart.

Bart,
Thanks, that works perfectly.  I've tried a number of them and this one
works.



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----


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

Date: Sat, 18 Nov 2000 15:49:34 -0000
From: "Tango" <heh@bbbb.org>
Subject: hello i am new
Message-Id: <8v68f3$q04$1@neptunium.btinternet.com>

This is a multi-part message in MIME format.

------=_NextPart_000_01F9_01C05177.259D5580
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


HELLO I AM NEW TO THIS GROUP. CANB SOMEONE TELL ME WHAT IT IS ABOUT, I =
HEARD ABOUT IT IN ALT.POKEMON

THANX


JAMES

------=_NextPart_000_01F9_01C05177.259D5580
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D6>HELLO I AM NEW TO THIS GROUP. CANB =
SOMEONE TELL ME=20
WHAT IT IS ABOUT, I HEARD ABOUT IT IN ALT.POKEMON</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D6>THANX</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D6>JAMES</FONT></DIV></BODY></HTML>

------=_NextPart_000_01F9_01C05177.259D5580--



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

Date: Sat, 18 Nov 2000 18:03:15 +0100
From: not-for-mail@copyleft.de (Michael Koehne)
Subject: Re: How do I ensure that only a single instance of my script is running  (in Linux)?
Message-Id: <joc6v8.3q.ln@bakunin.copyleft.de>

Craig Manley <c.manley@chello.nl> wrote:
> Thanks. This is the function I created and it works:

  great - now merge your original idea - to detect stale locks !

  So write your pid into the lockfile, and use "ps" to check if the
  process who has the lock is still running.
  
  But wait - take a look at File::Lock and File::Flock on CPAN first !

Bye Michael
-- 
  mailto:kraehe@copyleft.de     	UNA:+.? 'CED+2+:::Linux:1.2:13'UNZ+1'
  http://www.xml-edifact.org/		CETERUM CENSEO MSDOS ESSE DELENDAM


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

Date: Sat, 18 Nov 2000 16:23:43 +0100
From: Craig Manley <c.manley@chello.nl>
Subject: Re: How do I ensure that only a single instance of my script is running  (in Linux)?
Message-Id: <3A169EFF.3B3A3F83@chello.nl>

Hi Gwyn,

Thanks. This is the function I created and it works:

#####
# Name		: isSingleInstance
# Description	: Checks that only one instance of this program is active.
# Parameters	: none
# Returns	: boolean result
####
sub isSingleInstance {
 my ($fv_Base,$fv_Path,$fv_Type) = fileparse($0,'\..+');
 my $fv_FHdl;
 sysopen(fv_FHdl, "$fv_Path$fv_Base.lock", O_WRONLY | O_CREAT, 0600) ||
(return 0);
 flock(fv_FHdl, LOCK_EX | LOCK_NB) || (return 0);
 return 1; 
}



Gwyn Judd wrote:
> 
> I was shocked! How could Dan Wilga <dwilgaREMOVE@mtholyoke.edu>
> say such a terrible thing:
> >Using "ps" repeatedly seems like a costly way of doing this to me. Why not
> >just use a lock file of some sort?
> >
> >  die "Hey! I'm already running!\n" if -e "my-program.lock";
> >  open( OUT, ">my-program.lock" ) || die;
> >  close OUT;
> 
> This fails of course if two processes attempt to open the lock file at
> exactly the same time. Better to attempt to actually flock the file which
> will work and also the lock is released if the process ever dies.
> 
> --
> Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
> The end of the world will occur at three p.m., this Friday, with symposium
> to follow.


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

Date: Sat, 18 Nov 2000 16:29:11 +0100
From: Craig Manley <c.manley@chello.nl>
Subject: How do you execute another process with an immediate return using Linux?
Message-Id: <3A16A047.FE6A99C6@chello.nl>

Hi,

I've got a problem where I have a CGI script that needs to execute
another (and different) Perl script to do some lengthy processing. What
I need is to execute the script with an immediate return so that the CGI
user doesn't have to wait. Does anybody know how this can be achieved
using Linux and Perl?

-Craig Manley.


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

Date: Sat, 18 Nov 2000 15:52:20 GMT
From: "Rob" <email@address.com>
Subject: Re: How do you execute another process with an immediate return using Linux?
Message-Id: <UAxR5.12364$tU2.104248@news-server.bigpond.net.au>

perldoc -f fork

There is also an excellent example on just what you ask in Programming Perl.

Rob


--
The email address should read - rob at cowsnet dot com


"Craig Manley" <c.manley@chello.nl> wrote in message
news:3A16A047.FE6A99C6@chello.nl...
> Hi,
>
> I've got a problem where I have a CGI script that needs to execute
> another (and different) Perl script to do some lengthy processing. What
> I need is to execute the script with an immediate return so that the CGI
> user doesn't have to wait. Does anybody know how this can be achieved
> using Linux and Perl?
>
> -Craig Manley.




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

Date: Sat, 18 Nov 2000 15:38:32 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: How do you execute another process with an immediate return using Linux?
Message-Id: <G488s8.5xJ@news.muni.cz>

On Sat, 18 Nov 2000 16:29:11 +0100, Craig Manley <c.manley@chello.nl> wrote:
> Hi,
> 
> I've got a problem where I have a CGI script that needs to execute
> another (and different) Perl script to do some lengthy processing. What
> I need is to execute the script with an immediate return so that the CGI
> user doesn't have to wait. Does anybody know how this can be achieved
> using Linux and Perl?

	system (q! /your/other/script & !);

See perlipc(1) man page for how to make even more backgroup (daemon)
process.

Yours,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------


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

Date: Sat, 18 Nov 2000 15:46:48 GMT
From: "Johan M. Ditmar" <johan.ditmar@telia.com>
Subject: I am sorry for posting this so many times!
Message-Id: <IvxR5.6420$jv2.794013@newsc.telia.net>

Hi all,

I apologize for posting this message so many times. I donīt think itīs my
fault, it must have something to do with the newsgroup server at my work or
outlook. I did not do it to get more attention.

Sorry again,

Johan

"Johan Ditmar" <johan.ditmar@era.ericsson.se> wrote in message
news:8v65me$in0$1@newstoo.ericsson.se...
> Hi all,
>
> I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
> the following problem. I want to upload a file from a webpage and save it
at
> a server. I am using the following code to do that:
>
>    $bitfile = param("bitfile");
>
>    open (SAVE,">./bitfile.bit") || die $!;
>    binmode(SAVE);
>
>     while ( read($bitfile,$data,1024) ) {
>       print SAVE $data;
>     }
>    close SAVE;
>
> What it does is that it takes the file handle and then saves the clients
> file under 'bitfile.bit' on the server.
>
> Sometimes this works, but many times it happens that the file is not saved
> (it is created, but has size 0 or is only 1 byte long). I have enough
space
> on my disk and enough memory. Could this be a bug?
>
> Johan
>
>




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

Date: 18 Nov 2000 17:09:00 +0200
From: kaih=7q7QQ7JHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Illegal hexadecimal digit '}'?!
Message-Id: <7q7QQ7JHw-B@khms.westfalen.de>

I don't understand the problem here.

Why does it suddenly complain about this when it's fine on all those other  
lines?

And why 4 errors for a line that has only two "}"?

'Script' wurde gestartet: Sat Nov 18 17:03:11 2000
$ perl -c bad.pl
Illegal hexadecimal digit '}' ignored at bad.pl line 30.
Illegal hexadecimal digit '}' ignored at bad.pl line 30.
Illegal hexadecimal digit '}' ignored at bad.pl line 30.
Illegal hexadecimal digit '}' ignored at bad.pl line 30.
bad.pl syntax OK
$ cat bad.pl

require v5.6;
use utf8;
no bytes;
use strict;
use warnings;

sub sf_messfor
{
	my ($body) = @_;
	my @tokens;
	while (length $body) {
		my $token;
		($token, $body) = ($body =~ /^((?:[^\x{0D}\x{0A}\x{20}\x{09}\(\)\<\>\[\]\:\;\@\\\,\"]+)|(?:\"(?:[^\\\"]|(?:\\.))*\")|(?:\[(?:[^\[\]\\]|(?:\\.))*\])|[\x{0D}\x{0A}\x{20}\x{09}]+|.)(.*)$/s);
		my $tokentext = $token;
		if ($token eq '(') {
			my $cnt = 1;
			my $t;
			while ($cnt) {
				($t, $body) = ($body =~ /^(\(|\)|(?:[^\(\)\\]|(?:\\.))+)(.*)$/s);
				$cnt++ if ($t eq '(');
				$cnt-- if ($t eq ')');
				$tokentext .= $t;
			}
			$token = '';
		}
		elsif ($token =~ /\S/) {
			$token =~ s/^[\x{0D}\x{0A}\x{20}\x{09}]+//gs;
			$token =~ s/[\x{0D}\x{0A}\x{20}\x{09}]+$//gs;
			$token =~ s/\x{0D}\x{0A}//gs;
			$token =~ s/\\//gs;
		}
		else {
			$token = '';
		}
		push @tokens, [$token, $tokentext];
	}
	return \@tokens;
}

$ exit
'Script' beendet: Sat Nov 18 17:03:29 2000

Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
  Platform:
    osname=linux, osvers=2.2.16, archname=i386-linux
    uname='linux perv 2.2.16 #1 thu aug 3 05:50:30 pdt 2000 i586 unknown '
    config_args='-de -D prefix=/usr -D archname=i386-linux -D startperl=#!/usr/bin/perl-5.6 -D privlib=/usr/lib/perl5/5.6 -D archlib=/usr/lib/perl5/5.6/i386-linux -D sitelib=/usr/local/lib/site_perl -D man1dir=/usr/share/man/man1 -D man1ext=1p -D man3di
r=/usr/share/man/man3 -D man3ext=3pm -D ccflags=-D_REENTRANT -DDEBIAN -DAPPLLIB_EXP="/usr/lib/perl5" -D optimize=-O2  -D cccdlflags=-fPIC -D d_dosuid=define -U usesfio -D d_csh=undef -D d_statblks=define -D i_db -D i_ndbm -U installusrbinperl -D pager=/
usr/bin/pager -D perladmin=perl@packages.debian.org -D useshrplib -D libperl=libperl.so.5.6.0 -D vendorprefix=/usr -D vendorlib=/usr/lib/perl5/5.005 -D vendorarch=/usr/lib/perl5/5.005/i386-linux'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=undef d_sfio=undef uselargefiles=define
    use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
  Compiler:
    cc='cc', optimize='-O2 ', gccversion=2.95.2 20000220 (Debian GNU/Linux)
    cppflags='-D_REENTRANT -DDEBIAN -DAPPLLIB_EXP="/usr/lib/perl5" -fno-strict-aliasing -I/usr/local/include'
    ccflags ='-D_REENTRANT -DDEBIAN -DAPPLLIB_EXP="/usr/lib/perl5" -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
    stdchar='char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -ldl -lm -lc -lposix -lcrypt
    libc=/lib/libc-2.1.3.so, so=so, useshrplib=true, libperl=libperl.so.5.6.0
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl):
  Compile-time options: USE_LARGE_FILES
  Built under linux
  Compiled at Nov  6 2000 22:25:50
  @INC:
    /usr/lib/perl5/i386-linux
    /usr/lib/perl5
    /usr/lib/perl5/5.6/i386-linux
    /usr/lib/perl5/5.6
    /usr/local/lib/site_perl/i386-linux
    /usr/local/lib/site_perl
    /usr/lib/perl5/5.005/i386-linux
    /usr/lib/perl5/5.005
    .

Kai
-- 
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
  - Russ Allbery (rra@stanford.edu)


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

Date: Sat, 18 Nov 2000 15:06:16 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: looking for graphing script
Message-Id: <G487AG.LBG@news.muni.cz>

On Mon, 13 Nov 2000 10:36:49 -0500, Andrew Pasetti <andrew_pasetti@harvard.edu> wrote:
> I'm looking for a reliable graphing script to graph network performance. Can
> someone make a few recommendations?

MRTG. or GD or GNUPlot, if you want to draw the graphs yourself.

Yours,

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------


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

Date: 18 Nov 2000 08:27:51 -0600
From: Randall <tech-removethis-@rch-usa.com>
Subject: Re: Newbie Rename() Function
Message-Id: <a34d1tgra3br6l2gid5caf6gv6614repcv@4ax.com>

>> and I've got to use the rename() function to get the files uploaded to
>> keep the same name as they had. Where is this inserted?
>
>http://www.perl.com/pub/doc/manual/html/lib/CGI.html#CREATING_A_FILE_UPLOAD_FIELD
>
>says:
>
> When the form is processed, you can retrieve the entered filename by
>calling param(). 
>
>            $filename = $query->param('uploaded_file');

Thanks. Can you tell me where the FAQ is?


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

Date: Sat, 18 Nov 2000 09:49:30 -0600
From: Todd Anderson <todd@mrnoitall.com>
Subject: print 'Location:
Message-Id: <3A16A394.7D96A047@mrnoitall.com>

Dear Sirs,
I am trying to write a script that would be run by cron. I'm not sure of
how to prompt another scipt on another server.
The code below will only add the last name on the list.

 #!/usr/bin/perl
 open(LIST,"names.txt");
 @array=<LIST>;
 close(LIST);
 $number = "0";
 foreach $name (@array ) {
 $number ++;
 chomp($name);
#code in question....
 print 'Location:
http://my.com/?Add2&Login=$name&password=$name&DomainID=678679\n\n';
  sleep(3);
 }
 print qq~Success~;




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

Date: Sat, 18 Nov 2000 15:48:17 -0000
From: "Tango" <heh@bbbb.org>
Subject: Re: print 'Location:
Message-Id: <8v68cl$jo6$1@uranium.btinternet.com>

This is a multi-part message in MIME format.

------=_NextPart_000_01EE_01C05176.F802D5A0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I don't know

Todd Anderson <todd@mrnoitall.com> wrote in message =
news:3A16A394.7D96A047@mrnoitall.com...
> Dear Sirs,
> I am trying to write a script that would be run by cron. I'm not sure =
of
> how to prompt another scipt on another server.
> The code below will only add the last name on the list.
>=20
>  #!/usr/bin/perl
>  open(LIST,"names.txt");
>  @array=3D<LIST>;
>  close(LIST);
>  $number =3D "0";
>  foreach $name (@array ) {
>  $number ++;
>  chomp($name);
> #code in question....
>  print 'Location:
> =
http://my.com/?Add2&Login=3D$name&password=3D$name&DomainID=3D678679\n\n'=
;
>   sleep(3);
>  }
>  print qq~Success~;
>=20
>=20

------=_NextPart_000_01EE_01C05176.F802D5A0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D4>I don't know</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D4>Todd Anderson &lt;<A=20
href=3D"mailto:todd@mrnoitall.com">todd@mrnoitall.com</A>&gt; wrote in =
message <A=20
href=3D"news:3A16A394.7D96A047@mrnoitall.com">news:3A16A394.7D96A047@mrno=
itall.com</A>...</FONT></DIV><FONT=20
face=3DArial size=3D4>&gt; Dear Sirs,<BR>&gt; I am trying to write a =
script that=20
would be run by cron. I'm not sure of<BR>&gt; how to prompt another =
scipt on=20
another server.<BR>&gt; The code below will only add the last name on =
the=20
list.<BR>&gt; <BR>&gt; &nbsp;#!/usr/bin/perl<BR>&gt;=20
&nbsp;open(LIST,"names.txt");<BR>&gt; =
&nbsp;@array=3D&lt;LIST&gt;;<BR>&gt;=20
&nbsp;close(LIST);<BR>&gt; &nbsp;$number =3D "0";<BR>&gt; &nbsp;foreach =
$name=20
(@array ) {<BR>&gt; &nbsp;$number ++;<BR>&gt; =
&nbsp;chomp($name);<BR>&gt; #code=20
in question....<BR>&gt; &nbsp;print 'Location:<BR>&gt; <A=20
href=3D"http://my.com/?Add2&amp;Login=3D$name&amp;password=3D$name&amp;Do=
mainID=3D678679\n\n'">http://my.com/?Add2&amp;Login=3D$name&amp;password=3D=
$name&amp;DomainID=3D678679\n\n'</A>;<BR>&gt;=20
&nbsp; sleep(3);<BR>&gt; &nbsp;}<BR>&gt; &nbsp;print =
qq~Success~;<BR>&gt;=20
<BR>&gt; </FONT></BODY></HTML>

------=_NextPart_000_01EE_01C05176.F802D5A0--



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

Date: Sat, 18 Nov 2000 17:08:06 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: print 'Location:
Message-Id: <G48CxI.AHq@news.muni.cz>

On Sat, 18 Nov 2000 09:49:30 -0600, Todd Anderson <todd@mrnoitall.com> wrote:
> Dear Sirs,
> I am trying to write a script that would be run by cron. I'm not sure of
> how to prompt another scipt on another server.
> The code below will only add the last name on the list.
> 
>  #!/usr/bin/perl
>  open(LIST,"names.txt");
>  @array=<LIST>;
>  close(LIST);
>  $number = "0";
>  foreach $name (@array ) {
>  $number ++;
>  chomp($name);
> #code in question....
>  print 'Location:
> http://my.com/?Add2&Login=$name&password=$name&DomainID=678679\n\n';
>   sleep(3);
>  }
>  print qq~Success~;

If you want variables expanded and \n recognized, you need to use
doublequotes. Otherwise your script is fine -- it's open the file
names.txt and print the lines for you. When run as cron job, the lines
will arrive by email.

What do you mean by "promt another scipt"? What did you want the
script to do?

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
Petition for a Software Patent Free Europe http://petition.eurolinux.org
------------------------------------------------------------------------


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

Date: Fri, 17 Nov 2000 15:58:08 +0100
From: "Johan Ditmar" <johan.ditmar@era.ericsson.se>
Subject: Problems saving an uploaded file.
Message-Id: <8v625t$c36$1@newstoo.ericsson.se>

Hi all,

I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
the following problem. I want to upload a file from a webpage and save it at
a server. I am using the following code to do that:

   $bitfile = param("bitfile");

   open (SAVE,">./bitfile.bit") || die $!;
   binmode(SAVE);

    while ( read($bitfile,$data,1024) ) {
      print SAVE $data;
    }
   close SAVE;

What it does is that it takes the file handle and then saves the clients
file under 'bitfile.bit' on the server.

Sometimes this works, but many times it happens that the file is not saved
(it is created, but has size 0 or is only 1 byte long). I have enough space
on my disk and enough memory. Could this be a bug?

Johan




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

Date: Fri, 17 Nov 2000 15:58:08 +0100
From: "Johan Ditmar" <johan.ditmar@era.ericsson.se>
Subject: Problems saving an uploaded file.
Message-Id: <8v63u6$feq$1@newstoo.ericsson.se>

Hi all,

I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
the following problem. I want to upload a file from a webpage and save it at
a server. I am using the following code to do that:

   $bitfile = param("bitfile");

   open (SAVE,">./bitfile.bit") || die $!;
   binmode(SAVE);

    while ( read($bitfile,$data,1024) ) {
      print SAVE $data;
    }
   close SAVE;

What it does is that it takes the file handle and then saves the clients
file under 'bitfile.bit' on the server.

Sometimes this works, but many times it happens that the file is not saved
(it is created, but has size 0 or is only 1 byte long). I have enough space
on my disk and enough memory. Could this be a bug?

Johan




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

Date: Fri, 17 Nov 2000 15:58:08 +0100
From: "Johan Ditmar" <johan.ditmar@era.ericsson.se>
Subject: Problems saving an uploaded file.
Message-Id: <8v65me$in0$1@newstoo.ericsson.se>

Hi all,

I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
the following problem. I want to upload a file from a webpage and save it at
a server. I am using the following code to do that:

   $bitfile = param("bitfile");

   open (SAVE,">./bitfile.bit") || die $!;
   binmode(SAVE);

    while ( read($bitfile,$data,1024) ) {
      print SAVE $data;
    }
   close SAVE;

What it does is that it takes the file handle and then saves the clients
file under 'bitfile.bit' on the server.

Sometimes this works, but many times it happens that the file is not saved
(it is created, but has size 0 or is only 1 byte long). I have enough space
on my disk and enough memory. Could this be a bug?

Johan




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

Date: Fri, 17 Nov 2000 15:58:08 +0100
From: "Johan Ditmar" <johan.ditmar@era.ericsson.se>
Subject: Problems saving an uploaded file.
Message-Id: <8v67eo$m2l$1@newstoo.ericsson.se>

Hi all,

I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
the following problem. I want to upload a file from a webpage and save it at
a server. I am using the following code to do that:

   $bitfile = param("bitfile");

   open (SAVE,">./bitfile.bit") || die $!;
   binmode(SAVE);

    while ( read($bitfile,$data,1024) ) {
      print SAVE $data;
    }
   close SAVE;

What it does is that it takes the file handle and then saves the clients
file under 'bitfile.bit' on the server.

Sometimes this works, but many times it happens that the file is not saved
(it is created, but has size 0 or is only 1 byte long). I have enough space
on my disk and enough memory. Could this be a bug?

Johan




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

Date: Fri, 17 Nov 2000 15:58:08 +0100
From: "Johan Ditmar" <johan.ditmar@era.ericsson.se>
Subject: Problems saving an uploaded file.
Message-Id: <8v6970$p9u$1@newstoo.ericsson.se>

Hi all,

I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
the following problem. I want to upload a file from a webpage and save it at
a server. I am using the following code to do that:

   $bitfile = param("bitfile");

   open (SAVE,">./bitfile.bit") || die $!;
   binmode(SAVE);

    while ( read($bitfile,$data,1024) ) {
      print SAVE $data;
    }
   close SAVE;

What it does is that it takes the file handle and then saves the clients
file under 'bitfile.bit' on the server.

Sometimes this works, but many times it happens that the file is not saved
(it is created, but has size 0 or is only 1 byte long). I have enough space
on my disk and enough memory. Could this be a bug?

Johan




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

Date: Fri, 17 Nov 2000 15:58:08 +0100
From: "Johan Ditmar" <johan.ditmar@era.ericsson.se>
Subject: Problems saving an uploaded file.
Message-Id: <8v6av8$sk1$1@newstoo.ericsson.se>

Hi all,

I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
the following problem. I want to upload a file from a webpage and save it at
a server. I am using the following code to do that:

   $bitfile = param("bitfile");

   open (SAVE,">./bitfile.bit") || die $!;
   binmode(SAVE);

    while ( read($bitfile,$data,1024) ) {
      print SAVE $data;
    }
   close SAVE;

What it does is that it takes the file handle and then saves the clients
file under 'bitfile.bit' on the server.

Sometimes this works, but many times it happens that the file is not saved
(it is created, but has size 0 or is only 1 byte long). I have enough space
on my disk and enough memory. Could this be a bug?

Johan




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

Date: Fri, 17 Nov 2000 15:58:08 +0100
From: "Johan Ditmar" <johan.ditmar@era.ericsson.se>
Subject: Problems saving an uploaded file.
Message-Id: <8v6cng$2ff$1@newstoo.ericsson.se>

Hi all,

I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
the following problem. I want to upload a file from a webpage and save it at
a server. I am using the following code to do that:

   $bitfile = param("bitfile");

   open (SAVE,">./bitfile.bit") || die $!;
   binmode(SAVE);

    while ( read($bitfile,$data,1024) ) {
      print SAVE $data;
    }
   close SAVE;

What it does is that it takes the file handle and then saves the clients
file under 'bitfile.bit' on the server.

Sometimes this works, but many times it happens that the file is not saved
(it is created, but has size 0 or is only 1 byte long). I have enough space
on my disk and enough memory. Could this be a bug?

Johan




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

Date: Fri, 17 Nov 2000 15:58:08 +0100
From: "Johan Ditmar" <johan.ditmar@era.ericsson.se>
Subject: Problems saving an uploaded file.
Message-Id: <8v6efo$5eq$1@newstoo.ericsson.se>

Hi all,

I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
the following problem. I want to upload a file from a webpage and save it at
a server. I am using the following code to do that:

   $bitfile = param("bitfile");

   open (SAVE,">./bitfile.bit") || die $!;
   binmode(SAVE);

    while ( read($bitfile,$data,1024) ) {
      print SAVE $data;
    }
   close SAVE;

What it does is that it takes the file handle and then saves the clients
file under 'bitfile.bit' on the server.

Sometimes this works, but many times it happens that the file is not saved
(it is created, but has size 0 or is only 1 byte long). I have enough space
on my disk and enough memory. Could this be a bug?

Johan




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

Date: Fri, 17 Nov 2000 15:58:08 +0100
From: "Johan Ditmar" <johan.ditmar@era.ericsson.se>
Subject: Problems saving an uploaded file.
Message-Id: <8v6g81$8gc$1@newstoo.ericsson.se>

Hi all,

I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
the following problem. I want to upload a file from a webpage and save it at
a server. I am using the following code to do that:

   $bitfile = param("bitfile");

   open (SAVE,">./bitfile.bit") || die $!;
   binmode(SAVE);

    while ( read($bitfile,$data,1024) ) {
      print SAVE $data;
    }
   close SAVE;

What it does is that it takes the file handle and then saves the clients
file under 'bitfile.bit' on the server.

Sometimes this works, but many times it happens that the file is not saved
(it is created, but has size 0 or is only 1 byte long). I have enough space
on my disk and enough memory. Could this be a bug?

Johan




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

Date: Fri, 17 Nov 2000 15:58:08 +0100
From: "Johan Ditmar" <johan.ditmar@era.ericsson.se>
Subject: Problems saving an uploaded file.
Message-Id: <8v6i09$bln$1@newstoo.ericsson.se>

Hi all,

I am using Apache 1.3 together with ActiveState Perl 5.6.0.618 and I have
the following problem. I want to upload a file from a webpage and save it at
a server. I am using the following code to do that:

   $bitfile = param("bitfile");

   open (SAVE,">./bitfile.bit") || die $!;
   binmode(SAVE);

    while ( read($bitfile,$data,1024) ) {
      print SAVE $data;
    }
   close SAVE;

What it does is that it takes the file handle and then saves the clients
file under 'bitfile.bit' on the server.

Sometimes this works, but many times it happens that the file is not saved
(it is created, but has size 0 or is only 1 byte long). I have enough space
on my disk and enough memory. Could this be a bug?

Johan




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

Date: Sat, 18 Nov 2000 16:59:17 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Problems saving an uploaded file.
Message-Id: <o8dd1tsqm9j0jqvdlsnmtgmge1119qln22@4ax.com>

Johan Ditmar wrote:

[snip]

Ok, enough already. I think I've already seen 50 (!) copies of this one
post. Somebody disable this guy's software.

>X-Newsreader: Microsoft Outlook Express 4.72.3612.1700

Oh yeah. No surprise there. The stuff from the "Public Beta Company".

-- 
	Bart.


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

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


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