[17731] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5151 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 19 14:05:34 2000

Date: Tue, 19 Dec 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: <977252714-v9-i5151@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 19 Dec 2000     Volume: 9 Number: 5151

Today's topics:
    Re: #!/usr/bin/perl alternative? (Michael Fuhr)
    Re: #!/usr/bin/perl alternative? (Mike Eggleston)
    Re: (Beginner) Simple stuff not working (Ben Okopnik)
    Re: (Beginner) Simple stuff not working (Arek P)
    Re: (Beginner) Simple stuff not working (Tad McClellan)
    Re: backslah as a normal char nobull@mail.com
    Re: beginner question <jboes@eoexchange.com>
    Re: cant work how to get regex to do something like (pa <jboes@eoexchange.com>
    Re: cant work how to get regex to do something like (pa <tamm@scotlegal.com>
        date,time -> seconds <ng@fnmail.com>
    Re: date,time -> seconds <davet2@usa.net>
    Re: date,time -> seconds <bcaligari@my-deja.com>
    Re: DBD:mysql <timallen449@coldmail.com>
        Help me for "DBI->connect failed: Sorry, too many clien 9186191861@my-deja.com
    Re: Help with Multi-dimensional array nobull@mail.com
    Re: how to invalidate a hash value during a foreach loo (Richard Zilavec)
    Re: just mucking about with splits (Richard Zilavec)
    Re: just mucking about with splits (Rafael Garcia-Suarez)
    Re: Newbie Question. <jboes@eoexchange.com>
        Oraperl <jwhitt@webaccess.net>
        Pattern <thanh.q.lam@alcatel.com>
    Re: Pattern <mothra@nowhereatall.com>
    Re: Pattern nobull@mail.com
    Re: Pattern <bcaligari@my-deja.com>
    Re: perl hanging under iis <ubl@schaffhausen.de>
        Perl substitution problem <ofuuzo@ub.uit.no>
    Re: Perl to TCP/IP Connection & Overall Direction Neede <uri@sysarch.com>
    Re: perl vote script. <jboes@eoexchange.com>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi (Mark W. Schumann)
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi (Abigail)
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi (Tad McClellan)
        Running programs as user supplying input <seppy@chartermi.net>
    Re: Splitting record string into fields (Richard Zilavec)
    Re: Splitting text, but not individual words <davet2@usa.net>
    Re: String Parsing? spcman@my-deja.com
        what is perldoc? alazarev1981@my-deja.com
    Re: what is perldoc? <theglauber@my-deja.com>
    Re: what is perldoc? (Tad McClellan)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: 19 Dec 2000 09:11:44 -0700
From: mfuhr@dimensional.com (Michael Fuhr)
Subject: Re: #!/usr/bin/perl alternative?
Message-Id: <91o1c0$su0@flatland.dimensional.com>

mikee@kensho.eggtech.com (Mike Eggleston) writes:

> Seems I remember someone had once proposed an alternative to
> #!/usr/bin/perl a shell script line that would search for
> the perl binary and re-exec the script with the proper magic.
>
> Does anyone remember what that line was?

See the perlrun manual page.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/


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

Date: 19 Dec 2000 18:49:48 GMT
From: mikee@kensho.eggtech.com (Mike Eggleston)
Subject: Re: #!/usr/bin/perl alternative?
Message-Id: <slrn93vbec.qf9.mikee@kensho.eggtech.com>

On 19 Dec 2000 09:11:44 -0700, Michael Fuhr <mfuhr@dimensional.com> wrote:
>mikee@kensho.eggtech.com (Mike Eggleston) writes:
>
>> Seems I remember someone had once proposed an alternative to
>> #!/usr/bin/perl a shell script line that would search for
>> the perl binary and re-exec the script with the proper magic.
>>
>> Does anyone remember what that line was?
>
>See the perlrun manual page.

That was it; thanks.


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

Date: 19 Dec 2000 16:36:55 GMT
From: fuzzybear@pocketmail.com (Ben Okopnik)
Subject: Re: (Beginner) Simple stuff not working
Message-Id: <slrn93v3m8.og7.fuzzybear@Odin.Thor>

The ancient archives of Tue, 19 Dec 2000 14:50:42 -0000 showed
Garry Heaton of comp.lang.perl.misc speaking thus:
>Sorry, it was REALLY stupid after all. !# should be #! of course
>
>"Garry Heaton" <garry@heaton6.freeserve.co.uk> wrote in message
>news:91nsb3$i87$1@newsg2.svr.pol.co.uk...
>> This is probably really stupid but I was practcing some short 2 or
>3-liners
>> with the split function to get used to using it but every time I hit
>perl -w
>> ex.pl in MS-DOS I received a "Can't modify not in scalar assignment at
>line
>> .... " error. At first I thought I'd used split wrongly but I eventually
>> whittled the script down to 2 simple lines:
>>
>> !#c:/perl/bin/perl.exe
>>
>> $phrase = "Its about time";
>> print phrase;
>>
>> Still the same error message.


Shouldn't 'print phrase' be 'print $phrase'? I would think that this is 
where the error comes from.

'perl -w', what a _useful_ thing. It'll chide you, laugh at you, and e-mail
your errors to every known Perl hacker in the Universe - but at least you
know what's happening. :)



Ben Okopnik
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Each success only buys an admission ticket to a more difficult problem.
 -- Henry Kissinger


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

Date: Tue, 19 Dec 2000 11:54:40 EST
From: Arek@nospam._pietruszewski_.com (Arek P)
Subject: Re: (Beginner) Simple stuff not working
Message-Id: <91o3sg$1g6q$1@earth.superlink.net>

I think that You have bigger problems than hash-bang line
try
$phrase="fdsfdsfsd";
print $phrase;   #NOTICE THE $ in front of var name

I suggest that U read some more about perl, try faq that came with
(activestate?) perl that U've installed.  It will save U some of those
beginner headaches :)  
BTW, the #! notation is not almost never used in Win machines,
Your script works because You have c:\perl\bin in Your path and .pl
associated with perl executable.

On Tue, 19 Dec 2000 14:50:42 -0000, "Garry Heaton"
<garry@heaton6.freeserve.co.uk> wrote:



>Sorry, it was REALLY stupid after all. !# should be #! of course
>
>"Garry Heaton" <garry@heaton6.freeserve.co.uk> wrote in message
>news:91nsb3$i87$1@newsg2.svr.pol.co.uk...
>> This is probably really stupid but I was practcing some short 2 or
>3-liners
>> with the split function to get used to using it but every time I hit
>perl -w
>> ex.pl in MS-DOS I received a "Can't modify not in scalar assignment at
>line
>> .... " error. At first I thought I'd used split wrongly but I eventually
>> whittled the script down to 2 simple lines:
>>
>> !#c:/perl/bin/perl.exe
>>
>> $phrase = "Its about time";
>> print phrase;
>>
>> Still the same error message.
>>
>>
>>
>
>



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

Date: Tue, 19 Dec 2000 11:11:23 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: (Beginner) Simple stuff not working
Message-Id: <slrn93v25b.9uo.tadmc@magna.metronet.com>

Arek P <Arek@nospam._pietruszewski_.com> wrote:

>BTW, the #! notation is not almost never used in Win machines,
                         ^^^        ^^^^^

(I figure you wanted only one negative in there?)


Every good Perl programmer enables warnings.

You can enable warnings on the she-bang line (even in windoze).

Therefore, lots of "Win machines" do in fact use the "#! notation"

:-)



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


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

Date: 19 Dec 2000 17:52:02 +0000
From: nobull@mail.com
Subject: Re: backslah as a normal char
Message-Id: <u9g0jk70zh.fsf@wcl-l.bham.ac.uk>

lalot@univ-aix.fr (Lalot Dominique) writes:

> s/\\/|/g
> if I have 4 backslah, then I get 2 | instead of |

I do not belive you - post code that you think illustrates this.

> second problem, about the same..
> Is there a way to change the quote \ caracter.

Possibly using the overloaded constants or source filtering mechanisms
but I would not recommend it.

> I am trying to substitute NT registries with double \\ in the path
> and even \\\\ It's quite awfull to use 8 backslash..
> I try $string='\\\\server\\share';
> s/$string/$another/g

I recommend:

$string='\\\\\\\\server\\\\share';
s/$string/$another/g;

Or

$string=qr/\\\\server\\share/;
s/$string/$another/g;

Or
 
$string=quotemeta '\\\\server\\share';
s/$string/$another/g;

Or
 
$string='\\\\server\\share';
s/\Q$string/$another/g;Or

Or
 
$string='//server/share';
$string =~ tr/\//\\/;
s/\Q$string/$another/g;

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 19 Dec 2000 11:23:01 -0500
From: "Jeff Boes" <jboes@eoexchange.com>
Subject: Re: beginner question
Message-Id: <3a3f8d09$0$35015$44a10c7e@news.net-link.net>

Unless my newsreader has been taken over by the Illuminati, I think
"Martin Schmidt" <mcs2@pitt.edu> babbled:

> Hi, I'm writing a perl program that uses a few array variables named
> something like
> @array1, @array2, @array3
> 
> I want to access them using a variable to represent the number.
> $num = 1;
> 
> @array$num            These don't work.
> @array{$num}
> @array${num}
> 
> 
> Any idea how to access an array using a scalar as part of the name?

Part of your answer can be found in the FAQ:

$ perldoc -q 'variable name'


The short answer is that "you don't want to do this". Probably better is
to set up an array of references to the arrays:

my @array1 = ();
my @array2 = ();
my @array3 = ();
my @arrayrefs = (\@array1, \@array2, \@array3);
# or
# my @arrayrefs = \( @array1, @array2, @array3 );

Now, to get at the first element of an array, you can do something like:

print $arrayrefs[1]->[2];  # equiv. to $array2[2]


-- 
Jeff Boes <jboes@eoexchange.com>          Tel:  (616) 381-9889 x.18
Sr. Software Engineer, EoExchange, Inc.   http://www.eoexchange.com/
Search, Monitor, Notify.                  http://www.eomonitor.com/


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

Date: Tue, 19 Dec 2000 11:15:03 -0500
From: "Jeff Boes" <jboes@eoexchange.com>
Subject: Re: cant work how to get regex to do something like (pattern)\1{14}
Message-Id: <3a3f8ab1$1$30002$44a10c7e@news.net-link.net>

Unless my newsreader has been taken over by the Illuminati, I think "Tam
McLaughlin" <tamm@scotlegal.com> babbled:

> I  have a pipe dellimeted fle where i need to replace the 17th (last)
> feild which does not end with a pipe. I want to be able to say "look for
> fist 16 occurances of xxx|     and then then look for the next field
> (last one - the one to be replaced) and then replace with the first 16th
> occurances matched and then the modified data but just cannot get it to
> work.

Seems like you're making this way too hard. If the file is
pipe-delimited, and you are sure there are no pipe-characters :within:
fields, then something like this:

while (<>) {
  chomp $_;
  my @fields = split (/\|/, $_);
  $fields[-1] = some_other_value;
  print join('|', @fields), "\n";
}

will do the trick.

-- 
Jeff Boes <jboes@eoexchange.com>          Tel:  (616) 381-9889 x.18
Sr. Software Engineer, EoExchange, Inc.   http://www.eoexchange.com/
Search, Monitor, Notify.                  http://www.eomonitor.com/


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

Date: Tue, 19 Dec 2000 16:40:45 -0000
From: "Tam McLaughlin" <tamm@scotlegal.com>
Subject: Re: cant work how to get regex to do something like (pattern)\1{14}
Message-Id: <v33o19.v21.ln@mail.scotlegal.com>

thanks everyone for those great suggestions.

Tam McLaughlin wrote in message ...
>I  have a pipe dellimeted fle where i need to replace the 17th (last) feild
>which
>does not end with a pipe.
>I want to be able to say "look for fist 16 occurances of xxx|     and then
>then look for the
>next field (last one - the one to be replaced) and then replace with the
>first 16th occurances
>matched and then the modified data but just cannot get it to work. I was
>trying
>
>
>I have tried
>s/([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>([^\|]*\|)
>(.*$)/\1\2\3\4\5\6\7\8\9\10\11\12\13\14\15\16 new-string /xg;
>
>
>
>but this does not work because it does not like the \10 \11 etc and I
cannot
>find how to
>use a back reference greater than \9. Also I am sure there must be a way to
>say smthg
>like
>
> s/([^\|]*\|){16}(.*$)/\1{16} new-string/g;
>
>
>any pointers would be helpful
>thanks.
>
>




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

Date: Tue, 19 Dec 2000 10:12:24 -0600
From: "Enrico Ng" <ng@fnmail.com>
Subject: date,time -> seconds
Message-Id: <91o19f$mdn$1@info1.fnal.gov>

I know how to go the other way, but How do I convert a date/time like nov 15
2001 19:02:00 to seconds?

--
Enrico Ng <ng@fnmail.com>




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

Date: Tue, 19 Dec 2000 17:29:52 +0100
From: "Dave T" <davet2@usa.net>
Subject: Re: date,time -> seconds
Message-Id: <3a3f8c4b$0$9665$73beb97d@news.dk.uu.net>

I am using timelocal, and assume you are using a similar module.

to do this:
$time_in_secs=&timelocal($sec,$min,$hour,$day,$month,$year);

But you will need to convert the date by subtracting 1900, and also subtract
1 from the month (after conversion to a month number first!)



"Enrico Ng" <ng@fnmail.com> wrote in message
news:91o19f$mdn$1@info1.fnal.gov...
> I know how to go the other way, but How do I convert a date/time like nov
15
> 2001 19:02:00 to seconds?
>
> --
> Enrico Ng <ng@fnmail.com>
>
>




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

Date: Tue, 19 Dec 2000 16:47:24 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: date,time -> seconds
Message-Id: <91o3eo$2vn$1@nnrp1.deja.com>



http://theoryx5.uwinnipeg.ca/CPAN/data/perl/Time/Local.html

In article <91o19f$mdn$1@info1.fnal.gov>,
  "Enrico Ng" <ng@fnmail.com> wrote:
> I know how to go the other way, but How do I convert a date/time like
nov 15
> 2001 19:02:00 to seconds?
>
> --
> Enrico Ng <ng@fnmail.com>
>
>


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 19 Dec 2000 20:10:54 +0100
From: "tim allen" <timallen449@coldmail.com>
Subject: Re: DBD:mysql
Message-Id: <91ob87$nan$1@diana.bcn.ttd.net>

"hotschi" <jenshoja@t-online.de> wrote in message
news:91nmbi$oj2$04$1@news.t-online.com...
>Hello,
>can anyone tell me where I can download the DBD driver for mysql.
>Thanx
http://www.symbolstone.org/technology/perl/DBI/index.html
--
unmunge?cold=hot





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

Date: Tue, 19 Dec 2000 18:47:38 GMT
From: 9186191861@my-deja.com
Subject: Help me for "DBI->connect failed: Sorry, too many clients already."
Message-Id: <91oag8$9rt$1@nnrp1.deja.com>

my cgi program is test.cgi:
#######################
require "./connectdb.pl";
&connectdatabase();
$query="select count(*) from messages";
$sth=$dbh->prepare($query);
$sth->execute();
$count=$sth->fetchrow_array();
print "Content-type: text/html\n\n";
print <<"TAG";
<html>
<body>
<h2> The count is $count. </h2>
</body>
</html>
TAG
exit 0;
#############
my connectdb.pl :
sub connectdatabase {
#  my ($dbusername,$dbpassword)=@_;
  $dbusername="postgres";
  $dbpassword="lokicom";
  $dbname="mboardsony";
  use DBI;
  $dbh=DBI->connect
("dbi:Pg:dbname=$dbname",$dbusername,$dbpassword)
or die "can
not connect to $dbname\n";
}
1;
#######################
my os is Redhat 6.2,and perl 5.005,and  web
server is Apache.
The problem is:when I run test.cgi,it can work
properly.But when I press F5
to refresh the web page for sever minutes,the
Apache will have error message:
"DBI->connect failed: Sorry, too many clients
already."
  Who can help me?
  Thank you ahead.

  My email: joel_xue@hotmail.com


Sent via Deja.com
http://www.deja.com/


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

Date: 19 Dec 2000 17:54:21 +0000
From: nobull@mail.com
Subject: Re: Help with Multi-dimensional array
Message-Id: <u9elz470vm.fsf@wcl-l.bham.ac.uk>

Raymond WAN <rwan@cs.mu.OZ.AU> writes:

>     push @grid, [ @tmp ];

Right

>   $biggrid[$i] = \@grid;
>   $i++;

Wrong.

How come you knew how to "push @grid" but had forgotten how to do it
by the time you got a few lines further on?

How come you knew that you had to say "[ @tmp ]" rather than "\@tmp" but
had forgotten this fact by the time you got a few lines further on?

Of course if you'd made appropriate use of my() you'd not have create
references to anonymous copies of the arrays in the fisrt place.

Rule of thumb: always declare all variables lexically scoped in
the smallest enclosing scope unless you have a reason not to.  This
applies not just in Perl but in all languages that have the concept of
lexically scoped variables (such as C).

> 	Alternatively, if I could, on line 5 "push" directly into
> $biggrid[$i], that would be great...I could remove the grid variable.

You can, but this would actually be _less_ efficinet and less Perlish.

push @{$biggrid[$i]}, [ @tmp ];

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 19 Dec 2000 16:51:10 GMT
From: rzilavec@tcn.net (Richard Zilavec)
Subject: Re: how to invalidate a hash value during a foreach loop?
Message-Id: <3a50916f.82006993@news.tcn.net>

On Tue, 19 Dec 2000 15:18:45 GMT, "Olwynn" <info@jjmackay.ca> wrote:

>#!/usr/bin/perl -w
># Mailing script to get these damn christmas cards out
># Richard Owen 18/12/00
>
>print "Content-type:  text/html\n\n";
>print "<HTML>";
>print "<HEAD><TITLE>TEST FOR CARDS</TITLE></HEAD>";
>print "<BODY>";
>print "<H2>Emails sent to:</H2>";
>
>
>$text = $ENV{'QUERY_STRING'};
>
>my @value_pairs = split (/&/,$text);
>my %form_results = ();
>
>foreach $pair (@value_pairs)
>
>    ($key, $value) = split (/=/,$pair);
>    $value =~ tr/+/ /;
>    $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
>    $form_results{$key} = $value;
>}
>
>foreach $key (sort keys(%form_results)) {
	# unless the value is empty, you might want to strip
whitespace first
	unless($form_results{$key} =~ /^$/) {

--
 Richard Zilavec
 rzilavec@tcn.net


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

Date: Tue, 19 Dec 2000 16:40:27 GMT
From: rzilavec@tcn.net (Richard Zilavec)
Subject: Re: just mucking about with splits
Message-Id: <3a4c8f2a.81426574@news.tcn.net>

On Tue, 19 Dec 2000 14:26:25 -0000, "Igor Aptekar"
<igor_aptekar@programmer.net> wrote:

>this brings up a lot of errors - no compile

For me too..
>>
>> Try print (split /,/,$a)[1];

my $tmp =  (split/,/, $string)[1];
print $tmp. "\n";

Works fine..

--
 Richard Zilavec
 rzilavec@tcn.net


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

Date: Tue, 19 Dec 2000 16:53:28 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: just mucking about with splits
Message-Id: <slrn93v4ji.n5c.rgarciasuarez@rafael.kazibao.net>

Dick Latshaw wrote in comp.lang.perl.misc:
> In article <Z5J%5.73304$eT4.5370213@nnrp3.clara.net>,
>   "Igor Aptekar" <igor_aptekar@programmer.net> wrote:
> > anyone know how i can do something like print split(",",$a)[1]
> >
> > thats is get whatever item of the split array i want without using an
> > intermediate variable
> 
> Try print (split /,/,$a)[1];

which is parsed as
    (print (split /,/,$a))[1];
and then doesn't work.

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Tue, 19 Dec 2000 11:11:55 -0500
From: "Jeff Boes" <jboes@eoexchange.com>
Subject: Re: Newbie Question.
Message-Id: <3a3f8ab1$0$30002$44a10c7e@news.net-link.net>

Unless my newsreader has been taken over by the Illuminati, I think
"LithiuS" <dchester@bigpond.net.auforce> babbled:

> I'm working on extracting information from a txt file.  Whats a good web
> tutorial on doing that?
> 

Check here: http://www.stonehenge.com/merlyn/WebTechniques/. Randal
Schwartz has a large number of his columns archived here. Several have to
do with extracting data from text files (for example, webserver logs).


-- 
Jeff Boes <jboes@eoexchange.com>          Tel:  (616) 381-9889 x.18
Sr. Software Engineer, EoExchange, Inc.   http://www.eoexchange.com/
Search, Monitor, Notify.                  http://www.eomonitor.com/


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

Date: Tue, 19 Dec 2000 11:23:19 -0700
From: "Josh Whitt" <jwhitt@webaccess.net>
Subject: Oraperl
Message-Id: <3a3fa634@news.webaccess.net>

One question:

Is there a version of oraperl for Perl5?

Thanks, Josh





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

Date: Tue, 19 Dec 2000 12:47:17 -0500
From: Thanh Q Lam <thanh.q.lam@alcatel.com>
Subject: Pattern
Message-Id: <3A3F9F25.6BC6FE98@alcatel.com>

This is a multi-part message in MIME format.
--------------210B639D3AFBA53B0EEF64B1
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hi All,

I want to retrieve the creation date of a file and store it to a
variable in Perl, is there a way to retrieve it?

example:
-rw-r--r--   1 user   software   63772672 Dec  8 10:11 Current.tar.gz

Then I use the above date in other routine for comparison


Your help will be very appreciated!

Thanks,
Thanh
--------------210B639D3AFBA53B0EEF64B1
Content-Type: text/x-vcard; charset=us-ascii;
 name="thanh.q.lam.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Thanh Q Lam
Content-Disposition: attachment;
 filename="thanh.q.lam.vcf"

begin:vcard 
n:Lam;Thanh Q
tel;fax:(613) 591-3680
tel;work:(613) 784-6570
x-mozilla-html:FALSE
org:Alcatel CID;Network and Service Management
adr:;;600 March Road	;Kanata;Ontario;K2K 2E6;Canada
version:2.1
email;internet:thanh.q.lam@alcatel.com
title:System Integrator
x-mozilla-cpt:;-20240
fn:Thanh Q Lam
end:vcard

--------------210B639D3AFBA53B0EEF64B1--



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

Date: Tue, 19 Dec 2000 10:03:08 -0800
From: mothra <mothra@nowhereatall.com>
Subject: Re: Pattern
Message-Id: <3A3FA2DC.99A6470C@nowhereatall.com>



Thanh Q Lam wrote:

> Hi All,
>
> I want to retrieve the creation date of a file and store it to a
> variable in Perl, is there a way to retrieve it?
>
> example:
> -rw-r--r--   1 user   software   63772672 Dec  8 10:11 Current.tar.gz
>
> Then I use the above date in other routine for comparison
>
> Your help will be very appreciated!
>
> Thanks,
> Thanh

perldoc -f stat




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

Date: 19 Dec 2000 18:04:16 +0000
From: nobull@mail.com
Subject: Re: Pattern
Message-Id: <u9d7eo70f3.fsf@wcl-l.bham.ac.uk>

Thanh Q Lam <thanh.q.lam@alcatel.com> writes:

> Newsgroups: comp.lang.perl.modules,comp.lang.perl.misc,comp.lang.perl.tk

Please explain what you think this has to do with modules or TK?

> I want to retrieve the creation date of a file and store it to a
> variable in Perl,

perldoc -f stat

Note: On Unix none of the timestamps is actually creation date.


> --------------210B639D3AFBA53B0EEF64B1
> Content-Type: text/x-vcard; charset=us-ascii;
>  name="thanh.q.lam.vcf"

This is a plaintext newsgroup do not post post VCARD here.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 19 Dec 2000 18:23:26 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Pattern
Message-Id: <91o92k$8gc$1@nnrp1.deja.com>



I used 'stat' and 'localtime' on some reporting scripts

Brendon
++++

In article <3A3F9F25.6BC6FE98@alcatel.com>,
  Thanh Q Lam <thanh.q.lam@alcatel.com> wrote:
> This is a multi-part message in MIME format.
> --------------210B639D3AFBA53B0EEF64B1
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> Hi All,
>
> I want to retrieve the creation date of a file and store it to a
> variable in Perl, is there a way to retrieve it?
>
> example:
> -rw-r--r--   1 user   software   63772672 Dec  8 10:11 Current.tar.gz
>
> Then I use the above date in other routine for comparison
>
> Your help will be very appreciated!
>
> Thanks,
> Thanh


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 19 Dec 2000 18:01:17 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: perl hanging under iis
Message-Id: <3A3F945D.C6329C9F@schaffhausen.de>

markus rietzler schrieb:
> 
> hi,
> i have a problem with active state perl 5.6.0, iis and DBI/DBD:ODBC.
> after doing the database connection (retrieve data from an access
> mdb-file) the perl process is hanging and will not be
> stopped/killed/ended correctly under iis. does anyone have an idea from
> which side (perl, dbi or IIS) the problem comes?

I had this problem with too many mysql connection open
simulataneously. Perl seems to wait forever for a new
connection. Not being able to kill the process is a windows
problem.

->malte


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

Date: Tue, 19 Dec 2000 19:32:24 +0100
From: ofuuzo <ofuuzo@ub.uit.no>
Subject: Perl substitution problem
Message-Id: <3A3FA9B8.3CFCAEAA@ub.uit.no>

When I  fill a html  form for "Name"  with the following (for example):

 . Social Science
      .  History
      .  Economics
 . Science
    . Mathematics
    . Computer Science

It appears exactly like that on the database.   I would like before the
same data is displayed on the browser to undergo substitution. After the
substitution, it would be converted to html tags:

<ul><li>Social Science</li>  <br>
<ul><li>History</li> <br>
<li>Economics</li></ul> <br>
<li>Science</li>
<ul><li>Mathematics</li><br>
<li>Computer Science</li>
</ul>

I have tried ($row  =~ s/\n/<BR>/g; ......; but I could not get the
correct subsitution.  I have read perl regular exp. and pattern
matching, but no help. Can anyone help?

Thanks in advance.

- Ofuuzo





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

Date: Tue, 19 Dec 2000 17:16:27 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl to TCP/IP Connection & Overall Direction Needed
Message-Id: <x7vgsge3h1.fsf@home.sysarch.com>


  TW> Ahh Uri, you are so free from the ravages of sarcasm. (-:

well, i did answer some of his queries. but his attitude about "I CAN DO
THIS I THINK" just is disgusting. he doesn't know anything about perl
and is way over his head and he spouts that. sarcasm was my mildest
emotion.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Tue, 19 Dec 2000 11:31:54 -0500
From: "Jeff Boes" <jboes@eoexchange.com>
Subject: Re: perl vote script.
Message-Id: <3a3f8f61$0$30004$44a10c7e@news.net-link.net>

You can find any number of polling scripts at resources like
www.cgi-resources.com. For example,

http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Survey_and_Voting/

lists a few dozen.


-- 
Jeff Boes <jboes@eoexchange.com>          Tel:  (616) 381-9889 x.18
Sr. Software Engineer, EoExchange, Inc.   http://www.eoexchange.com/
Search, Monitor, Notify.                  http://www.eomonitor.com/


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

Date: 19 Dec 2000 11:54:54 -0500
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <91o3su$ek5@junior.apk.net>

In article <915gb3$bbg$1@bob.news.rcn.net>,
Eric Bohlman <ebohlman@omsdev.com> wrote:
>                                                      or c) will give you
>a silly answer (e.g. one that works only for the exact sample input you
>gave).

Which reminds me.  Do we want a section on What To Do If Abigail Replies
To Your Post?



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

Date: 19 Dec 2000 17:14:45 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <slrn93v5s5.p3p.abigail@tsathoggua.rlyeh.net>

Mark W. Schumann (catfood@apk.net) wrote on MMDCLXVII September MCMXCIII
in <URL:news:91o3su$ek5@junior.apk.net>:
|| In article <915gb3$bbg$1@bob.news.rcn.net>,
|| Eric Bohlman <ebohlman@omsdev.com> wrote:
|| >                                                      or c) will give you
|| >a silly answer (e.g. one that works only for the exact sample input you
|| >gave).
|| 
|| Which reminds me.  Do we want a section on What To Do If Abigail Replies
|| To Your Post?


Well, what will you do?


Abigail
-- 
BEGIN {my $x = "Knuth heals rare project\n";
       $^H {integer} = sub {my $y = shift; $_ = substr $x => $y & 0x1F, 1;
       $y > 32 ? uc : lc}; $^H = hex join "" => 2, 1, 1, 0, 0}
print 52,2,10,23,16,8,1,19,3,6,15,12,5,49,21,14,9,11,36,13,22,32,7,18,24;


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

Date: Tue, 19 Dec 2000 11:19:38 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <slrn93v2kq.9uo.tadmc@magna.metronet.com>

Mark W. Schumann <catfood@apk.net> wrote:
>In article <915gb3$bbg$1@bob.news.rcn.net>,
>Eric Bohlman <ebohlman@omsdev.com> wrote:
>>                                                      or c) will give you
>>a silly answer (e.g. one that works only for the exact sample input you
>>gave).


I am specifically trying to avoid the "why"s as much as possible.

Let's concentrate on the "what"s, else it will get so big that
nobody will bother reading it.


>Which reminds me.  Do we want a section on What To Do If Abigail Replies
>To Your Post?


That depends on what class of Abigail (or anyone's) reply it was.

If it was an answer to an on-topic question not easily answered
by the standard docs, then:

   be thankful to have gotten help from one of the Perl illuminati.

If it was off-topic or in the docs, then:

   you have discovered the "why" to go with the "what"s  :-)


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


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

Date: Tue, 19 Dec 2000 14:05:31 -0500
From: "Brian E. Seppanen" <seppy@chartermi.net>
Subject: Running programs as user supplying input
Message-Id: <3A3FB17B.C1D2282B@chartermi.net>

Hello:

I've got a project that I'm currently working on and I've lost the trail
on how to accomplish what I need and I'm hoping someone might provide
additional insight.

I need to write a script that will check a users quota.   I've gotten a
start on it.  The problem with this script is that eventually I think
I'll have to do a system `quota $your_id`.   The data is submitted via a
web form (I need to also institute passwd checking), and I get a
permission denied error in error_log, because the program needs to be
run as the user checking their own quota.  Right now it's being run as
nobody, which is the apache process owner.  So I can't get quota
checking to work.  I was told to try doing system `su - $your_id -c
quota`, however, error_log indicates that input must be from tty.  Where
do I go with this if anyone would be so kind? 

How would I also incorporate authentication into this?  I'd really
appreciate any insights.

#!/usr/bin/perl -w

use CGI;

$query = new CGI;

print "Content-type: text/html\n\n";

##### I got you Babe! 
$your_id = $query->param('your_id');
$your_password = $query->param('your_password');


system `quota $your_id`;
system `su - $your_id -c quota`;
-- 
Brian Seppanen
Marquette, MI					seppy@chartermi.net


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

Date: Tue, 19 Dec 2000 16:24:53 GMT
From: rzilavec@tcn.net (Richard Zilavec)
Subject: Re: Splitting record string into fields
Message-Id: <3a4b8af6.80350218@news.tcn.net>

On Mon, 18 Dec 2000 20:27:58 GMT, appsman1368@my-deja.com wrote:

>I really don't have the time to learn perl at the

That makes this post off topic for this group, you might consider
using a search engine to find what you require.  However, it you do
decide to try Text::CSV_XS might be what your looking for.

--
 Richard Zilavec
 rzilavec@tcn.net


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

Date: Tue, 19 Dec 2000 17:26:08 +0100
From: "Dave T" <davet2@usa.net>
Subject: Re: Splitting text, but not individual words
Message-Id: <3a3f8b6f$0$9668$73beb97d@news.dk.uu.net>

Thanks for the info, I used the Text::Wrap module (I didn't even know it
existed) and it works exactly as I wanted.


"Tad McClellan" <tadmc@metronet.com> wrote in message
news:slrn93uu82.9nv.tadmc@magna.metronet.com...
> Dave T <davet2@usa.net> wrote:
> >
> >I have a variable ($text) with a lot of text in it, and I want to split
it
> >into lines of at most 80 characters, but not splitting the individual
words.
>
>
> Use a module that wraps text, such as Text::Wrap.
>
>
> --
>     Tad McClellan                          SGML consulting
>     tadmc@metronet.com                     Perl programming
>     Fort Worth, Texas




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

Date: Tue, 19 Dec 2000 17:35:55 GMT
From: spcman@my-deja.com
Subject: Re: String Parsing?
Message-Id: <91o69r$5ob$1@nnrp1.deja.com>

Thanks Anno!

>
> What is a character in your opinion?  Letters and numbers are usually
> counted among them.  Probably you meant to say "special characters".
>
> As usual, there is more than one way to do it.  While the most
> straightforward solution would probably use a regex, the tr///
> operator can be used as well, and is often faster.  To check
> a string $str you'd do:
>
>    if ( $str =~ tr/0-9A-Za-z//c ) {
>      print "'$str' has special characters\n"
>    } else {
>      print "'$str' is clean\n";
>    }
>
> To understand how this works, you will have to look up tr/// in
> perlop and see what it does in scalar context, as well as the
> function of tr's /c modifier.
>
> Anno
>
>


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 19 Dec 2000 17:43:46 GMT
From: alazarev1981@my-deja.com
Subject: what is perldoc?
Message-Id: <91o6og$673$1@nnrp1.deja.com>

Some people keep on putting the following text in their messages
without any explaination as to where it is:

perldoc perldsc
perldoc perllol

I am assuming it's some type of perl documentation on the web? Can
someone please tell me where I can find it? I'm trying to fake a 2d
array and I can't get it, I need more sources....ack!

Thanks in advance,

Alex Lazarevich
alazarev@itg.uiuc.edu


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 19 Dec 2000 18:42:55 GMT
From: glauber <theglauber@my-deja.com>
Subject: Re: what is perldoc?
Message-Id: <91oa7c$9ld$1@nnrp1.deja.com>

In article <91o6og$673$1@nnrp1.deja.com>,
  alazarev1981@my-deja.com wrote:
> Some people keep on putting the following text in their messages
> without any explaination as to where it is:
>
> perldoc perldsc
> perldoc perllol
>
> I am assuming it's some type of perl documentation on the web? Can
> someone please tell me where I can find it? I'm trying to fake a 2d
> array and I can't get it, I need more sources....ack!
[...]

It's a Perl script that gets installed automatically when you install Perl.
It is like the "man" command in Unix, but it operates within Perl's
documentation.

Type "perldoc perldoc" on the Unix prompt (or "DOS box" if you're using
Windoze) to see what i mean.

g


--
Glauber Ribeiro
theglauber@my-deja.com    http://www.myvehiclehistoryreport.com
"Opinions stated are my own and not representative of Experian"


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 19 Dec 2000 12:53:54 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: what is perldoc?
Message-Id: <slrn93v85i.a4p.tadmc@magna.metronet.com>

alazarev1981@my-deja.com <alazarev1981@my-deja.com> wrote:
>Some people keep on putting the following text in their messages
>without any explaination as to where it is:


Because it comes with the perl distribution. Folks assume that
you know what you have installed.

(if it wasn't really "you" that installed it, then find out
 who it was. Or, better yet, install perl (it is free) on
 your _own_ computer, so that you can access the docs.
)

If you cannot check the Perl docs, then you cannot post to
the Perl newsgroup, so you better find them one way or another.


>perldoc perldsc
>perldoc perllol
>
>I am assuming it's some type of perl documentation on the web? 


No. It is perl documentation already on your hard drive!


>Can
>someone please tell me where I can find it? 


Depends on where it got installed when you installed perl.

   perldoc perldoc

should work if 'perldoc' is in your path.

If not, then ask whoever it was that installed perl.


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


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

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


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