[17160] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4572 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 10 18:06:04 2000

Date: Tue, 10 Oct 2000 15:05:21 -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: <971215520-v9-i4572@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 10 Oct 2000     Volume: 9 Number: 4572

Today's topics:
    Re: 3rd try. Error Message when close (OUTFILE); but it translancer@my-deja.com
    Re: 3rd try. Error Message when close (OUTFILE); but it (Martien Verbruggen)
        ANNOUNCE Sub::Approx 1.02 <dave@dave.org.uk>
    Re: CGI::Push <troyr@vicnet.net.au>
    Re: comparing arrays (Gwyn Judd)
    Re: Concurrent access to data (Gwyn Judd)
        Counter Problems <asurani@nortelnetworks.com>
        creating an executable <Peter.Lubbers@oracle.com>
    Re: creating an executable <uri@sysarch.com>
    Re: creating an executable <felix.gourdeau@videotron.ca>
    Re: creating an executable <jdb@wcoil.com>
        Deleting named files? <longusername@NOSPAMhotmail.com>
    Re: Deleting named files? <uri@sysarch.com>
    Re: DMULTIPLICITY flag <Jonathan.L.Ericson@jpl.nasa.gov>
        errors in linux but not windows in script <pgapro@eclipse.net>
    Re: errors in linux but not windows in script <dwilgaREMOVE@mtholyoke.edu>
    Re: errors in linux but not windows in script <pgapro@eclipse.net>
    Re: factorial function problem (Tim)
    Re: How can I add 5 hours to the time my server reports <flavell@mail.cern.ch>
        HTML:Template and IIS schnurmann@my-deja.com
        Installing DBI on Windows Millennium (Marc)
        Mail::IMAPClient version 1.1 <david.kernen@bms.com>
        Multiple CGI objects rbfitzpa@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 10 Oct 2000 20:07:54 GMT
From: translancer@my-deja.com
Subject: Re: 3rd try. Error Message when close (OUTFILE); but it works
Message-Id: <8rvsuj$met$1@nnrp1.deja.com>

Correction to previous Search section:
Instead of
$record = $data[$count_record_line];
 It is
$record = $data[$line];


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


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

Date: Tue, 10 Oct 2000 22:04:27 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: 3rd try. Error Message when close (OUTFILE); but it works
Message-Id: <slrn8u74j2.8nu.mgjv@verbruggen.comdyn.com.au>

On Tue, 10 Oct 2000 17:29:15 GMT,
	translancer@my-deja.com <translancer@my-deja.com> wrote:
> In article <slrn8u65k9.2tj.mgjv@martien.heliotrope.home>,
>   mgjv@tradingpost.com.au wrote:
> > On Tue, 10 Oct 2000 12:42:51 GMT,
> >     translancer@my-deja.com <translancer@my-deja.com> wrote:
> > > How can I check the result of open, and the result of  close when doing
> > > piped opens
> >
> > _How_ do you check? Like this:
> >
> > $SIG{PIPE} = 'IGNORE';
> > open(THING, "| $program")
> >     or die "Can't run $program: $!";
> > print THING $some_stuff;
> > close(THING)
> >     or die $! ? "Error closing $program pipe: $!"
> >               : "Exit $? from $program";

> I'm modifying a comma-delimited database file (OUTFILE) previously
> recorded temporarily into @data, this way:
> if (! open(OUTFILE,"$dbfile")) { die "Can't open file";}
> @data = <OUTFILE>;
> close (OUTFILE);

Ah. Then why did you say you were using piped opens? I don't see a
pipe in there anywhere :)

You should include $! in error strings when printing errors from
system calls, like open, you use a few too many quotes, and a little
more idiomatic Perl would be:

open(OUTFILE, $dbfile) or die "Can't open $dbfile: $!";
@data = <OUTFILE>;
close (OUTFILE);

> Then, I make a search, find a record in a $line, this way:
> 
> $total_lines=@data;
> $line=0;
>      while ($line < $total_lines)
>      {
>      if (@data[$line] =~ /$search/i)
> 	{
> $record = $data[$count_record_line];

Hmmm.. That should never end. You don't increase $line anywhere.
You're trying to find the index of the first record that matches, right?

I'd probably do something like:

my $line = 0;
foreach (@data)
{
    last if /$search/;
    $line++;
}

> I modify $record and want to modify the database substituting the new
> record for the old one with
>          splice (@data, $line, 1, $record)

That makes sense. Although, in the code I just gave, you could just do
something like

my $line = 0;
foreach (@data)
{
    $_ = $record, last if /$search/;
    $line++;
}

or because you don't need the line number anymore:

foreach (@data)
{
    $_ = $record, last if /$search/;
}

This makes use of the fact that inside a foreach loop, $_ is aliases
to the actual element of the array you are looping over. So, by
assigning to $_, you modify the array element.

> I think I need to print the whole database (@data) now modified into
> the old database with
>          print OUPFILE @data;

That's correct. But you need to open the file for write first. You've
only got it open for read.

open(OUTFILE, ">$dbfile") or die "Can't open $dbfile: $!";
print OUTFILE @data;
close (OUTFILE);

If you potentially have multiple processes access this file, you
should use file locking. 

There is an entry in the FAQ about this:

# perldoc -q 'change.*line'
Found in /opt/perl/lib/5.6.0/pod/perlfaq5.pod
       How do I change one line in a file/delete a line in a
       file/insert a line in the middle of a file/append to the
       beginning of a file?
[snip]

or

# perldoc perlfaq5

> I attach the main part of the script at the end, but in my previous
> requests,I was more explicit, really. "They" refers to two pieces of
> script, both print statements (for adding new records and for updating
> others, which really work, but I get the "Internal Server Error" of
> misconfiguration on exit. (see Pedro Sanchez message/article in this
> forum on 8.10.2000)

Sounds like you are using CGI. Also read perl FAQ section 9

# perldoc perlfaq9

which deals with many CGI issues, including how to get meaningful
error messages. Since this is CGI, you should make sure you use file
locking.

# perldoc -q lock
# perldoc -f flock

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.   | you come to the end; then stop.
NSW, Australia                  | 


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

Date: Mon, 09 Oct 2000 20:17:45 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: ANNOUNCE Sub::Approx 1.02
Message-Id: <su6nhhpran4974@corp.supernews.com>

I've just released version 1.02 of Sub::Approx to the CPAN. It sohlud
appear at your favorite mirror very shortly.

This version incorpoates a number of patches which have been discussed
on the subapprox mailing list over the last few days. Specifically:

* Don't assume we're being called from main::
* Allow different packages to use different Approx semantics
* New tests (for the above patches)

and (which I forgot to put in the Changes file)

* Never try to match AUTOLOAD, DESTRY or END.

This is planned to be the last release of Sub::Approx 1.x as I have some
good ideas for a far more expandable architecture for Sub::Approx 2.0.
I'll be posting more details of this plan to the mailing list later
tonight.

If you'd like to join the mailing list, please got to
<http://www.astray.com/mailman/listinfo/subapprox>.

Cheers,

Dave...





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

Date: Wed, 11 Oct 2000 09:01:21 +1100
From: "Troy Rasiah" <troyr@vicnet.net.au>
Subject: Re: CGI::Push
Message-Id: <flME5.24969$O7.389256@ozemail.com.au>

----------------------------------------------------------------------------
----------------
"Malte Ubl" <ubl@schaffhausen.de> wrote in message
news:39E332B8.B027BA48@schaffhausen.de...
> Troy Rasiah schrieb:
>
> > This example is from the man page. Works fine with Netscape but doesn't
work
> > with Ie..in that the same data repeats itself. Does anyone know a work
> > around for this
> >
> > Does this work on Internet Explorer?
> >
> > use CGI::Push qw(:standard);
> >
> >     do_push(-next_page=>\&next_page,
> >             -last_page=>\&last_page,
> >             -delay=>0.5);
> >
> >     sub next_page {
> >         my($q,$counter) = @_;
> >         return undef if $counter >= 10;
> >         return start_html('Test'),
> >           h1('Visible'),"\n",
> >                "This page has been called ", strong($counter)," times",
> >                end_html();
> >       }
> >
> >      sub last_page {
> >   my($q,$counter) = @_;
> >          return start_html('Done'),
> >                 h1('Finished'),
> >                 strong($counter),' iterations.',
> >                 end_html;
> >      }
>
> Internet Explorer does not support Push.
>
> malte
>
>

dang..thats what i thought! hehe
anyone know if they plan on supporting it in the near future?




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

Date: Tue, 10 Oct 2000 19:41:56 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: comparing arrays
Message-Id: <slrn8u6sef.3sj.tjla@thislove.dyndns.org>

I was shocked! How could Wyzelli <wyzelli@yahoo.com>
say such a terrible thing:
>"Gwyn Judd" <tjla@guvfybir.qlaqaf.bet> wrote in message
>news:slrn8u5v4g.17l.tjla@thislove.dyndns.org...
>
>@array1 = qw(one two three four five);
>@array2 = qw(four five six seven eight);
>
>> @union = (@array1, @array2);
>>
>#  to get the items in 1 but not 2:
>>
>> @array1_not_2 = @array1;
>> delete @array1_not_2[@array2];
>
>delete argument is not a HASH element or slice at script line 10.

yeah yeah, I know I know :) So long as you don't care about order
(tested this time):

@union{@array1, @array2} = ();

@array1_not_2{@array1} = ();
delete @array1_not_2{@array2};

-- 
Gwyn 'I hate untested code' Judd
(print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Priority, n.:
	A measure of the importance of the user of a program.


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

Date: Tue, 10 Oct 2000 20:40:48 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Concurrent access to data
Message-Id: <slrn8u6vsr.3sj.tjla@thislove.dyndns.org>

I was shocked! How could Jeremy Mordkoff <mordkoff@xedia.com>
say such a terrible thing:
>This is a multi-part message in MIME format.

Please don't do that. This group is text only. Also can you post with
less than 80 characters per line (preferably less than 72).

>I either need concurrent access to my data or I need to serialize all
>access. My data is stored in flat ascii files. Up until now, I have
>relied on constructs such as that below to "guarantee" serial access,
>but every now and then I lose my data file. Is there a better construct
>to use? Or should I adopt a package that will allow me concurrent
>access?

Read the documentation:

perldoc -f lock
perldoc -q lock
perldoc perlopentut

Hope that helps.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Did you hear that Monica Lewinsky was picked up for money laundering?  
They found a load of bill's in her dress.


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

Date: Tue, 10 Oct 2000 16:12:23 -0400
From: "Surani, Alykhan" <asurani@nortelnetworks.com>
Subject: Counter Problems
Message-Id: <8rvt2o$mao$1@bcrkh13.ca.nortel.com>

Hello,

I am trying to install a cgi/perl counter on my page but I'm having some
trouble.
I uploaded the script to my cgi-bin and on the page I put the following:

<!--#exec cgi="/mtx-cgi/asurani/mcount.cgi" -- >

Does anyone know why this may not be working?

Thanks in advance,
Aly




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

Date: Tue, 10 Oct 2000 11:58:48 -0700
From: Peter Lubbers <Peter.Lubbers@oracle.com>
Subject: creating an executable
Message-Id: <39E366E8.6DEE409C@oracle.com>

Is there a way to create an executable perl program, so I can call it
from a JAVA program?
Thanks in advance,
Peter



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

Date: Tue, 10 Oct 2000 20:45:01 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: creating an executable
Message-Id: <x7pul81l4i.fsf@home.sysarch.com>

>>>>> "PL" == Peter Lubbers <Peter.Lubbers@oracle.com> writes:

  PL> Is there a way to create an executable perl program, so I can call it
  PL> from a JAVA program?

perl programs can never be executed. they have never been run on any
computer in the world. it is a big myth that perl is a programming
language. we have just suckered in another java weenie with this trap.

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, 10 Oct 2000 17:07:46 -0400
From: =?iso-8859-1?Q?F=E9lix?= Gourdeau <felix.gourdeau@videotron.ca>
Subject: Re: creating an executable
Message-Id: <39E38522.7CBD307D@videotron.ca>

> =

> Is there a way to create an executable perl program, so I can call it
> from a JAVA program?
> Thanks in advance,
> Peter

Yes, check http://www.indigostar.com/perl2exe.htm for more detail.
F=E9lix Gourdeau


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

Date: 10 Oct 2000 21:34:38 GMT
From: "Josiah" <jdb@wcoil.com>
Subject: Re: creating an executable
Message-Id: <8s021e$hf6$0@206.230.71.22>

Uri Guttman <uri@sysarch.com> wrote in message
news:x7pul81l4i.fsf@home.sysarch.com...
> >>>>> "PL" == Peter Lubbers <Peter.Lubbers@oracle.com> writes:
>
>   PL> Is there a way to create an executable perl program, so I can call
it
>   PL> from a JAVA program?
>
> perl programs can never be executed. they have never been run on any
> computer in the world. it is a big myth that perl is a programming
> language. we have just suckered in another java weenie with this trap.
>


*cackles* hehehe...they fell for it again...muh hah ha. People /still/
believe they can actually run a Perl program! HA ha HA!

cheers,

$from = <$josiah>;
--
   why doest thou lookest here? nothing to see here, move along now....i
said move along! :-)




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

Date: Tue, 10 Oct 2000 20:03:29 +0100
From: "CrinkleFish" <longusername@NOSPAMhotmail.com>
Subject: Deleting named files?
Message-Id: <8rvp1f$it7vq$1@ID-34145.news.cis.dfn.de>

Whenever I do

    unlink "test";

it deletes the file.

Whenever I do

    $file = "test";
    unlink $file;

nothing happens.

Having cracked my skull sharply against a brick wall, I still can't work it out.
My head hurts. What's happening?

--
Please help,

CrinkleFish

( careful of spambait in email address if replying )






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

Date: Tue, 10 Oct 2000 19:07:01 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Deleting named files?
Message-Id: <x7y9zw1pnu.fsf@home.sysarch.com>

>>>>> "C" == CrinkleFish  <longusername@NOSPAMhotmail.com> writes:

  C> Whenever I do
  C>     unlink "test";

  C> it deletes the file.

  C> Whenever I do

  C>     $file = "test";
  C>     unlink $file;

have you looked at the returned value of unlink and at $! afterwards if
it is false? it might help you out.

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, 10 Oct 2000 12:26:17 -0700
From: Jon Ericson <Jonathan.L.Ericson@jpl.nasa.gov>
Subject: Re: DMULTIPLICITY flag
Message-Id: <39E36D59.839854FE@jpl.nasa.gov>

Makhno wrote:
> I've been told to compile Perl with -DMULTIPLICITY.
> Not being entirely sure what this means, but still able to compile Perl, I
> tried
> 
> ./Configure -D -D -DMULTIPLICITY
> 
> Then the usual make etc.
> I don't think this worked however. Can someone suggest to me how I compile
> Perl with the -DMULTIPLICITY flag?

 ./Configure -Dusemultiplicity should work.

My Policy.sh has:

  usemultiplicity='define'

so that I can get the same effect with ./Configure -d

Jon
-- 
Knowledge is that which remains when what is
learned is forgotten. - Mr. King


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

Date: Tue, 10 Oct 2000 15:51:14 -0400
From: john <pgapro@eclipse.net>
Subject: errors in linux but not windows in script
Message-Id: <39E37331.2BB9EEDF@eclipse.net>


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

I have the following lines in a script that works great on my ActivePerl
in Windows but under perl 5.6 in Linux the compiler balks...  what is
going wrong?

First the line :

$nowstring = sprintf("%02i/%02i/%i
%02i:%02i:%02i",($mon+1),$mday,($year+1900),$hour,$min,$sec

Produces the following errors:

Bareword found where operator expected at /home/perl/new_postgre.pl line
61, near "02i"
        (Missing operator before i?)
syntax error at /home/perl/new_postgre.pl line 61, near "02i"
Bareword found where operator expected at /home/perl/new_postgre.pl line
61, near "%02i"
        (Missing operator before i?)
Bareword found where operator expected at /home/perl/new_postgre.pl line
61, near "02i"
        (Missing operator before i?)
Bareword found where operator expected at /home/perl/new_postgre.pl line
61, near "%02i"
        (Missing operator before i?)
Bareword found where operator expected at /home/perl/new_postgre.pl line
61, near "%02i"
        (Missing operator before i?)


and the line:

 my $urlsource =  "$sources{$sourceid}";

produces these errors

String found where operator expected at /home/perl/new_postgre.pl line
67, near "my $urlsource =  ""
  (Might be a runaway multi-line "" string starting on line 61)
        (Missing semicolon on previous line?)
Scalar found where operator expected at /home/perl/new_postgre.pl line
67, near "my $urlsource =  "$sources"
        (Do you need to predeclare my?)




Below is the whole section of code and the errors.
----------------

my %sources;

while($sth->FetchRow()){
    my(%data) = $sth->DataHash();
#    ...process the data...
#    Add to hash of hashes
    $sources{$data{'ExternalNewsSourceID'}} =  $data{'Source'};
}


#Create the RSS object to parse the RSS files retrieved...
my $rss = new XML::RSS;

($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
# preformatted string compatible with SQLServer's timestamp field
$nowstring = sprintf("%02i/%02i/%i
%02i:%02i:%02i",($mon+1),$mday,($year+1900),$hour,$min,$sec

#Walk through each of the XML sources
foreach $sourceid(keys %sources)
{
# fetch RSS file from the source's URL
    my $urlsource =  "$sources{$sourceid}";
    print "this is the source: $urlsource\n";
   `perl rss2html.pl $urlsource > $sourceid\.html`;



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

Bareword found where operator expected at /home/perl/new_postgre.pl line
61, near "02i"
        (Missing operator before i?)
syntax error at /home/perl/new_postgre.pl line 61, near "02i"
Bareword found where operator expected at /home/perl/new_postgre.pl line
61, near "%02i"
        (Missing operator before i?)
Bareword found where operator expected at /home/perl/new_postgre.pl line
61, near "02i"
        (Missing operator before i?)
Bareword found where operator expected at /home/perl/new_postgre.pl line
61, near "%02i"
        (Missing operator before i?)
Bareword found where operator expected at /home/perl/new_postgre.pl line
61, near "%02i"
        (Missing operator before i?)
String found where operator expected at /home/perl/new_postgre.pl line
67, near "my $urlsource =  ""
  (Might be a runaway multi-line "" string starting on line 61)
        (Missing semicolon on previous line?)
Scalar found where operator expected at /home/perl/new_postgre.pl line
67, near "my $urlsource =  "$sources"
        (Do you need to predeclare my?)
Execution of /home/perl/new_postgre.pl aborted due to compilation
errors.

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

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<b><font size=+2>I&nbsp;have the following lines in a script that works
great on my ActivePerl in Windows but under perl 5.6 in Linux the compiler
balks...&nbsp; what is going wrong?</font></b>
<p><u>First the line :</u><font color="#3333FF"></font>
<p><font color="#3333FF">$nowstring = sprintf("%02i/%02i/%i %02i:%02i:%02i",($mon+1),$mday,($year+1900),$hour,$min,$sec</font>
<p><u>Produces the following errors:</u>
<p><i>Bareword found where operator expected at /home/perl/new_postgre.pl
line 61, near "02i"</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing operator before
i?)</i>
<br><i>syntax error at /home/perl/new_postgre.pl line 61, near "02i"</i>
<br><i>Bareword found where operator expected at /home/perl/new_postgre.pl
line 61, near "%02i"</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing operator before
i?)</i>
<br><i>Bareword found where operator expected at /home/perl/new_postgre.pl
line 61, near "02i"</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing operator before
i?)</i>
<br><i>Bareword found where operator expected at /home/perl/new_postgre.pl
line 61, near "%02i"</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing operator before
i?)</i>
<br><i>Bareword found where operator expected at /home/perl/new_postgre.pl
line 61, near "%02i"</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing operator before
i?)</i>
<br>&nbsp;
<p>and the line:<font color="#000099"></font>
<p><font color="#000099">&nbsp;my $urlsource =&nbsp; "$sources{$sourceid}";</font>
<p><u>produces these errors</u>
<p><i>String found where operator expected at /home/perl/new_postgre.pl
line 67, near "my $urlsource =&nbsp; ""</i>
<br><i>&nbsp; (Might be a runaway multi-line "" string starting on line
61)</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing semicolon on
previous line?)</i>
<br><i>Scalar found where operator expected at /home/perl/new_postgre.pl
line 67, near "my $urlsource =&nbsp; "$sources"</i>
<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Do you need to predeclare
my?)</i>
<br>&nbsp;
<br>&nbsp;
<br>&nbsp;
<p>Below is the whole section of code and the errors.
<br>----------------
<p><font color="#3366FF">my %sources;</font>
<p>while($sth->FetchRow()){
<br>&nbsp;&nbsp;&nbsp; my(%data) = $sth->DataHash();
<br>#&nbsp;&nbsp;&nbsp; ...process the data...
<br>#&nbsp;&nbsp;&nbsp; Add to hash of hashes
<br>&nbsp;&nbsp;&nbsp; $sources{$data{'ExternalNewsSourceID'}} =&nbsp;
$data{'Source'};
<br>}
<br>&nbsp;
<p>#Create the RSS object to parse the RSS files retrieved...
<br>my $rss = new XML::RSS;
<p>($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
<br># preformatted string compatible with SQLServer's timestamp field
<br><font color="#3333FF">$nowstring = sprintf("%02i/%02i/%i %02i:%02i:%02i",($mon+1),$mday,($year+1900),$hour,$min,$sec</font>
<p>#Walk through each of the XML sources
<br>foreach $sourceid(keys %sources)
<br>{
<br># fetch RSS file from the source's URL
<br>&nbsp;&nbsp;&nbsp;<font color="#3333FF"> my $urlsource =&nbsp; "$sources{$sourceid}";</font>
<br>&nbsp;&nbsp;&nbsp; print "this is the source: $urlsource\n";
<br>&nbsp;&nbsp; `perl rss2html.pl $urlsource > $sourceid\.html`;
<br>&nbsp;
<br>&nbsp;
<p>----------------
<p>Bareword found where operator expected at /home/perl/new_postgre.pl
line 61, near "02i"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing operator before
i?)
<br>syntax error at /home/perl/new_postgre.pl line 61, near "02i"
<br>Bareword found where operator expected at /home/perl/new_postgre.pl
line 61, near "%02i"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing operator before
i?)
<br>Bareword found where operator expected at /home/perl/new_postgre.pl
line 61, near "02i"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing operator before
i?)
<br>Bareword found where operator expected at /home/perl/new_postgre.pl
line 61, near "%02i"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing operator before
i?)
<br>Bareword found where operator expected at /home/perl/new_postgre.pl
line 61, near "%02i"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing operator before
i?)
<br>String found where operator expected at /home/perl/new_postgre.pl line
67, near "my $urlsource =&nbsp; ""
<br>&nbsp; (Might be a runaway multi-line "" string starting on line 61)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Missing semicolon on previous
line?)
<br>Scalar found where operator expected at /home/perl/new_postgre.pl line
67, near "my $urlsource =&nbsp; "$sources"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Do you need to predeclare
my?)
<br>Execution of /home/perl/new_postgre.pl aborted due to compilation errors.</html>

--------------F39168E21B9213467D3288FF--



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

Date: Tue, 10 Oct 2000 20:06:23 GMT
From: Dan Wilga <dwilgaREMOVE@mtholyoke.edu>
Subject: Re: errors in linux but not windows in script
Message-Id: <dwilgaREMOVE-1EAE8A.16063910102000@news.mtholyoke.edu>

In article <39E37331.2BB9EEDF@eclipse.net>, john@eagleinfosystems.com wrote:

> I have the following lines in a script that works great on my ActivePerl
> in Windows but under perl 5.6 in Linux the compiler balks...  what is
> going wrong?
> 
[...]
> ($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
> # preformatted string compatible with SQLServer's timestamp field
> $nowstring = sprintf("%02i/%02i/%i
> %02i:%02i:%02i",($mon+1),$mday,($year+1900),$hour,$min,$sec
> 
> #Walk through each of the XML sources
> foreach $sourceid(keys %sources)

Looks to me like a missing ');' at the end of the sprintf.

Dan Wilga          dwilgaREMOVE@mtholyoke.edu
** Remove the REMOVE in my address address to reply reply  **


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

Date: Tue, 10 Oct 2000 17:52:35 -0400
From: john <pgapro@eclipse.net>
Subject: Re: errors in linux but not windows in script
Message-Id: <39E38FA3.BBCB6E4C@eclipse.net>

I found it....... missing  "  up near top of file.........................
thanks to everyone and sorry for the trouble....


Dan Wilga wrote:

> In article <39E37331.2BB9EEDF@eclipse.net>, john@eagleinfosystems.com wrote:
>
> > I have the following lines in a script that works great on my ActivePerl
> > in Windows but under perl 5.6 in Linux the compiler balks...  what is
> > going wrong?
> >
> [...]
> > ($sec,$min,$hour,$mday,$mon,$year) = localtime(time);
> > # preformatted string compatible with SQLServer's timestamp field
> > $nowstring = sprintf("%02i/%02i/%i
> > %02i:%02i:%02i",($mon+1),$mday,($year+1900),$hour,$min,$sec
> >
> > #Walk through each of the XML sources
> > foreach $sourceid(keys %sources)
>
> Looks to me like a missing ');' at the end of the sprintf.
>
> Dan Wilga          dwilgaREMOVE@mtholyoke.edu
> ** Remove the REMOVE in my address address to reply reply  **



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

Date: Tue, 10 Oct 2000 19:55:13 GMT
From: SPAM+indigo@dimensional.com (Tim)
Subject: Re: factorial function problem
Message-Id: <8FC99ABB8indigodimcom@166.93.207.145>

tony_curtis32@yahoo.com (Tony Curtis) wrote in 
<878zrxvlkv.fsf@limey.hpcc.uh.edu>:

>>> On Mon, 09 Oct 2000 19:21:26 GMT,
>>> SPAM+indigo@dimensional.com (Tim) said:
>
>> Just a pet peeve of mine, but why to textbooks always
>> use factorials as an example for recursion?  This is an
>> idiotic way to compute a a factorial.  I remember asking
>
>It's a beautiful way to *state* factorial though.  A
>factorial is a simple example of what recursion looks
>like.

I guess beauty is in the eye of the beholder.  I have seen plenty
of cool things done recursion.  The factorial thing is contrived
and stupid.

>Which is presumably the point that books are trying to
>make.

My take is the books are trying to teach recursion to an
audience who isn't ready for a real recursion problem.  Wait
until you get into tree structures before you throw recursion
out there.

>For more information, refer to this article.

Missing link?

-T


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

Date: Tue, 10 Oct 2000 20:23:11 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How can I add 5 hours to the time my server reports?
Message-Id: <Pine.GHP.4.21.0010102016010.21331-100000@hpplus03.cern.ch>

On Tue, 10 Oct 2000, Greg Miller wrote:

> On Mon, 9 Oct 2000 23:31:55 +0100, "Ben Graves"
> <ben.graves@virgin.net> wrote:
> 
> >My server reports a time exactly 5 hours behind GMT.

Are you sure that is the case at every point in time throughout the
year?

> >How do I add five hours to the time it reports in a way that also changes
> >the date?

I can't help worrying that the question Ben really wanted to ask is
"how can I determine the GMT date/time now"?  (to which the answer
would be gmtime).  Or maybe he meant "how can I determine the local
date/time in the UK", which of course is a different question.

> 	Pass (time()+60*60*5) to localtime.

That might be the right answer to the question that was asked, but
whether it's what Ben was trying to find out seems to me still an open
question.

In some OSes you can set the TZ environment to GMT0BST and then
ask for the localtime.  But this doesn't work for all OSes.  See
perldoc -q time   and    perldoc -f localtime




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

Date: Tue, 10 Oct 2000 18:31:52 GMT
From: schnurmann@my-deja.com
Subject: HTML:Template and IIS
Message-Id: <8rvnap$h6l$1@nnrp1.deja.com>

Has anyone ever tried using the HTML::Template module under Windows
2000 running IIS and Active Perl?  Does it work?


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


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

Date: Tue, 10 Oct 2000 21:33:21 GMT
From: tmp01@pandora.be (Marc)
Subject: Installing DBI on Windows Millennium
Message-Id: <39e38a2e.14997654@news.pandora.be>

Hello,

I'm trying to install the DBI and DBD::Mysql modules on windows
Millenium and I can't get it to work.  I tried CPAN, PPM ...
Is there someone how can give me detailed instructions to install this
modules manually?

Marc


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

Date: Tue, 10 Oct 2000 14:14:49 -0400
From: David J Kernen <david.kernen@bms.com>
Subject: Mail::IMAPClient version 1.1
Message-Id: <su6nhvaeoei17a@corp.supernews.com>

Mail::IMAPClient Version 1.19 has just been uploaded to CPAN and
should soon be available on a mirror near you!
This module was written to simplify the process of writing IMAP
clients in perl, and is now used by people on a number of
different IMAP server platforms. For more information on
Mail::IMAPClient, see the README file, or download the module and
check out the pod.

Here is an excerpt from the Changes file listing changes made
since version 1.18:


     Fixed a bug in which the Folder parameter returned
     quoted folder names, which sometimes caused other
     methods to requote the folders an extra time. (The IMAP
     protocol is real picky about that.) Thanks go to
     Felix Finch for both reporting the bug and identifying
     the fix.

     Siggy Thorarinsson contributed the new "unseen_count"
     method and suggested a new "peek mode"
     parameter. I have not yet gotten around to implementing
     the new parameter but have included the
     unseen_count method, since a) he was kind enough to
     write it, and b) it tests well.

     In the meantime, you cannot tell methods like
     "parse_headers" and "message_string" and so forth
     whether or not you want them to mark messages as
     "\Seen". So, to make life easier for you in particular
     I
     added a bunch of new methods: set_flag, unset_flag,
     see, and deny_seeing. The latter two are derivatives
     of the former two, respectively, which should make this
     sentence almost as difficult to parse as an IMAP
     conversation.

     Fixed bug in which "BAD" "OK" or "NO" lines prefixed by
     an asterisk (*) instead of the tag are not
     handled correctly. This is especially likely when LOGIN
     to a UW IMAP server fails. Thanks go to Phil
     Lobbes for squashing this bug.

     Fixed bug in logout that caused the socket handle to
     linger. Credit goes to Jean-Philippe Bouchard for
     reporting this bug and for identifying the fix.

     Fixed bug in uidvalidity method where folder has
     special characters in it.

     Made several bug fixes to the example script
     examples/find_dup_msgs.pl. Thanks to Steve Mayer for
     identifying these bugs.

     Changed Fast_io to automatically turn itself off if
     running on a platform that does not provide the
     necessary fcntl macros (I won't mention any names, but
     it's initials are "NT"). This will occur silently
     unless warnings are turned on or unless the Debug
     parameter is set to true. Previously scripts running on

     this platform had to turn off fast_io by hand, which is
     lame. (Thank you Kevin Cutts for reporting this
     problem.)

     Updated logic that X's out login credentials when
     printing debug output so that funky characters in
     "User" or "Password" parameters won't break the regexp.
     (Kevin Cutts found this one, too.)

     Tinkered with the Strip_cr method so it can accept
     multiple arguments OR an array reference as an
     argument. See the updated pod for more info.

     Fixed a typo in the documentation in the section
     describing the fetch method. There has been an entire
     paragraph missing from this section for who knows how
     long. Thanks to Adam Wells, who reported this
     documentation error.

     Fixed bug in seen, recent, and unseen methods that
     caused them to return empty arrays erroneously
     under certain conditions.

As you can see, a lot has been going on so if you're using this
module, be sure to download the latest and greatest.

Good Luck!

Dave Kernen
David.Kernen@erols.com




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

Date: Tue, 10 Oct 2000 21:38:53 GMT
From: rbfitzpa@my-deja.com
Subject: Multiple CGI objects
Message-Id: <8s029c$r9s$1@nnrp1.deja.com>

Can someone give me a brief explanation to why someone would need
multiple CGI objects in one perl script? I'm sure there are some good
reasons why but up till now I've always been able to accomplish what I
needed to without multiple CGI's. I want to make sure I'm not missing
out on anything.


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


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

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


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