[17635] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5055 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 7 14:27:40 2000

Date: Thu, 7 Dec 2000 11:05:15 -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: <976215914-v9-i5055@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 7 Dec 2000     Volume: 9 Number: 5055

Today's topics:
        ??newbie: s/// and \r jrogers42@hotmail.com
    Re: ??newbie: s/// and \r <mkuin@globalrangers.com>
    Re: ??newbie: s/// and \r <schneider@xtewa.de>
        Compiled Perl modules. <numberdog@hotmail.com>
    Re: Connecting to a Oracle 8i database via Perl (Abigail)
        File Creation Date / Time error jeffhenke@my-deja.com
        Format <lalit@engrs.unl.edu>
    Re: Format (Abigail)
    Re: Format <lalit@engrs.unl.edu>
    Re: Format <jeffrey.schwab@Sun.COM>
        GD.pm constructor hangs <jgoldst@my-deja.com>
    Re: Help - passing hash array into a subroutine (Stephen Patterson)
    Re: Help with HttpSniffer (Abigail)
    Re: Help with HttpSniffer <jdhunter@nitace.bsd.uchicago.edu>
    Re: Help with HttpSniffer (Joe Broz)
    Re: Help: How to read files from the end? <kapur@mts.jhu.edu>
        Help: storing metacharacters in a variable jrogers42@hotmail.com
    Re: Help: storing metacharacters in a variable <jeff@vpservices.com>
    Re: How can I access seconds since the epoch? <ubl@schaffhausen.de>
    Re: How can I access seconds since the epoch? (Abigail)
    Re: How to Exit from Inner Loop ??? <josef.moellers@fujitsu-siemens.com>
        how to get DOS 8.3 current directory <jonathan.kuhn@gsfc.nasa.gov>
    Re: How to insert Perl Code inside E-mail text? (Abigail)
        html source ->>> text-file <bert.tibergijn@skynet.be>
    Re: Interrupting HTML output <ubl@schaffhausen.de>
    Re: Linked lists (Abigail)
        MAC + Unix + Win2000 <ubl@schaffhausen.de>
    Re: Making Perl output window on NT scrollable. <schneider@xtewa.de>
        MIME::Lite message bounced by receiver server <olivier@aersoft.com>
        Net::SMTP->quit() ... does it really close socket conn? ken_shih@my-deja.com
    Re: Perl SQL Array <support@REMOVEdotmatrix.net>
    Re: Regular expression question <dhabersetzer@micron.com>
    Re: Running gnuplot from a script <broeker@physik.rwth-aachen.de>
        Using stat to get last mod.time <cleon42@my-deja.com>
        Win32::ODBC/MSAccess query rysmiel@my-deja.com
    Re: Yesterdays Date <ubl@schaffhausen.de>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 07 Dec 2000 16:20:43 GMT
From: jrogers42@hotmail.com
Subject: ??newbie: s/// and \r
Message-Id: <90odch$jek$1@nnrp1.deja.com>

Thanks,
 I'm a little new at using perl, but I have programmed in C++. I need
to remove the carriage return from a string. Any help on the syntax for
this?

Jason


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


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

Date: Thu, 7 Dec 2000 17:40:14 +0100
From: "Mark Kuin" <mkuin@globalrangers.com>
Subject: Re: ??newbie: s/// and \r
Message-Id: <90oehi$jds$1@news1.xs4all.nl>

If the carriage return is the last character
chomp $my_string;
should remove it.

<jrogers42@hotmail.com> wrote in message news:90odch$jek$1@nnrp1.deja.com...
> Thanks,
>  I'm a little new at using perl, but I have programmed in C++. I need
> to remove the carriage return from a string. Any help on the syntax for
> this?
>
> Jason
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.




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

Date: Thu, 07 Dec 2000 16:45:16 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: ??newbie: s/// and \r
Message-Id: <90oeqq$kma$1@nnrp1.deja.com>


>  I'm a little new at using perl, but I have programmed in C++. I need
> to remove the carriage return from a string. Any help on the syntax
for
> this?

chomp() "removes any line ending that corresponds to the current value
of $/".
So

$/ = "\r";
chomp $string;

should do the trick, I guess ...

And maybe you should put

$/ = "";

afterwards ...


--
Ciao,
SimBean.


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


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

Date: Thu, 07 Dec 2000 16:44:48 +0000
From: Mike <numberdog@hotmail.com>
Subject: Compiled Perl modules.
Message-Id: <3A2FBE7F.6A9083AD@hotmail.com>

Guys,
        is there an easy way for me to find out the list of modules that
has been compiled with PERL? There doesn't seem to be a command line
option to do this - or is there?






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

Date: 7 Dec 2000 17:04:23 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Connecting to a Oracle 8i database via Perl
Message-Id: <slrn92vgon.734.abigail@tsathoggua.rlyeh.net>

On 7 Dec 2000 03:17:10 -0600, Logan Shaw (logan@cs.utexas.edu) wrote in comp.lang.perl.misc <URL: news:<90nkim$ppt$1@pip.cs.utexas.edu>>:
++ In article <3A2F3F5E.AF5EA37C@gmx.de>, Michael  <mischay@gmx.de> wrote:
++ >can anybody tell me, which perl -modules I need to install, if I want to
++ >connect to an Oracle-Database using perl? Which version of perl do I
++ >need to install?
++ 
++ The latest version of Perl should do fine, as should 5.005.
++ 
++ You'll need to install two modules to be able to access your Oracle
++ database.  The first is the DBI, which is a set of generic database
++ access routines.  The second is the database driver (backend) for
++ Oracle.

Just to be pendantic, there's no *need* to install those modules.
They are *a* way to contact to an Oracle database, not the way.



Abigail


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

Date: Thu, 07 Dec 2000 16:51:38 GMT
From: jeffhenke@my-deja.com
Subject: File Creation Date / Time error
Message-Id: <90of6n$l3c$1@nnrp1.deja.com>

I have a script which runs on NT 4.0 that deletes (or renames) a file
based on it's age and then starts writing to new file with the same
(old) name.

The funny thing is that when the script deletes or renames the existing
file and starts writing to the new one, it retains the Date / Time for
the orginal file!  The problem is that this script runs at regular
intervals on a 24x7 basis - meaning that the file it is looking at is
always "old".

I stripped out all the specifics and have run this on any number of
machines, drives (network and local) and sure enough, whenever I delete
(or rename) a file (I have even used "if exists" logic to verify it's
gone) and then write to a new file with the same (original) name, that
new file retains the original create date / time stamp!

Here is some generic code that exhibts the problem.  Use any file -
first observe the "Created" date / time under properties in Explorer.
Then run this script.  It will delete the file, create a new one with a
simple one line heading.  Look at the create date / time for this new
file and you should see that it's not "the current date", but the date
from the orginal file instead!

# set the path and name of the file
$ArgValue = "\\\\server\\share\\folder\\AnyFile.dat";

    # verify it exists
    if (!(-e $ArgValue))
    {
        # get out if it's not there
        print "$ArgValue does not exist.\n";
        exit (100);
    }
    else
    {
        # if it exists, try to delete it
        if (!(unlink ($ArgValue)))
        {
            # if you can't bomb...
            $ErrMsg = $ErrMsg."Unable to delete log file\n";
            $ErrMsg = $ErrMsg."$ArgValue\n";
            $ErrMsg = $ErrMsg."$!\n";
            print $ErrMsg;
            exit (100);
        }

        # if you get here, it's gone - have inserted "if exists" logic
        # to verify - ommitted here

        # try to open / create a file with same name
        if (open(LOGFILE, "> $ArgValue"))

        {
            # write to file
            print LOGFILE "New File!";

        }

        else

        {
            # if you can't open it, add to msg log
            $ErrMsg = $ErrMsg."Unable to open log file:\n";
            $ErrMsg = $ErrMsg."$ArgValue\n";
            $ErrMsg = $ErrMsg."$!\n";
            print $ErrMsg;
            exit (100);
        }
    }

# the create date property in explorer is the date for the original file
# not the current date


I haven't gotten around to testing this in Unix - maybe it's an NT
thing.  Also, I came up with a "kluge" to workaround this for now so it
isn't a huge dilemma.  However, I spent several hours tracking this
down and a few more confirming it and it kind of bugs me!  If anyone
has ever seen or heard of anything like this I'd love to hear about
it.  I think I've broken a cardinal rule by making this
script "personal" - I really want to know what the heck is going on
(and why).

Thanks,
Jeff Henke
Wisconsin Electric Company


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


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

Date: Thu, 07 Dec 2000 10:39:39 -0600
From: Lalit <lalit@engrs.unl.edu>
Subject: Format
Message-Id: <3A2FBD4B.5B0F7AE3@engrs.unl.edu>

Hi! I am very new to perl. I have used it for writing a program that
returns a two dimensional list. The problem is that the number of
columns in that are variable according to the user input. When the # of
columns are more than 5, the output that I get is getting wrapped and
falling into the next line. This is spoiling the format of the output
file. Please help me out if anyone knows a way of getting over this
problem. I would really appreciate a detailed solution as I am very new
to Perl.

Thanks.



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

Date: 7 Dec 2000 17:05:39 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Format
Message-Id: <slrn92vgr3.734.abigail@tsathoggua.rlyeh.net>

On Thu, 07 Dec 2000 10:39:39 -0600, Lalit (lalit@engrs.unl.edu) wrote in comp.lang.perl.misc <URL: news:<3A2FBD4B.5B0F7AE3@engrs.unl.edu>>:
++ Hi! I am very new to perl. I have used it for writing a program that
++ returns a two dimensional list. The problem is that the number of
++ columns in that are variable according to the user input. When the # of
++ columns are more than 5, the output that I get is getting wrapped and
++ falling into the next line. This is spoiling the format of the output
++ file. Please help me out if anyone knows a way of getting over this
++ problem. I would really appreciate a detailed solution as I am very new
++ to Perl.


You could use a smaller font, or you put in the paper sideways.



Abigail


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

Date: Thu, 07 Dec 2000 11:19:38 -0600
From: Lalit <lalit@engrs.unl.edu>
Subject: Re: Format
Message-Id: <3A2FC6AA.6FC30923@engrs.unl.edu>

I do not need to print the file. I just need to create the text file and open it in excel or access for other users to manipulate.

Thanks


Abigail wrote:

> On Thu, 07 Dec 2000 10:39:39 -0600, Lalit (lalit@engrs.unl.edu) wrote in comp.lang.perl.misc <URL: news:<3A2FBD4B.5B0F7AE3@engrs.unl.edu>>:
> ++ Hi! I am very new to perl. I have used it for writing a program that
> ++ returns a two dimensional list. The problem is that the number of
> ++ columns in that are variable according to the user input. When the # of
> ++ columns are more than 5, the output that I get is getting wrapped and
> ++ falling into the next line. This is spoiling the format of the output
> ++ file. Please help me out if anyone knows a way of getting over this
> ++ problem. I would really appreciate a detailed solution as I am very new
> ++ to Perl.
>
> You could use a smaller font, or you put in the paper sideways.
>
> Abigail



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

Date: Thu, 07 Dec 2000 12:46:34 -0500
From: jeffrey schwab <jeffrey.schwab@Sun.COM>
Subject: Re: Format
Message-Id: <3A2FCCFA.DEFF7401@Sun.COM>

Are you outputting the data using the print command?  If so, the file on
disk will not have wrapped lines unless the print command specifically
contains a newline (\n) sequence.

Lalit wrote:
> 
> I do not need to print the file. I just need to create the text file and open it in excel or access for other users to manipulate.
> 
> Thanks
> 
> Abigail wrote:
> 
> > On Thu, 07 Dec 2000 10:39:39 -0600, Lalit (lalit@engrs.unl.edu) wrote in comp.lang.perl.misc <URL: news:<3A2FBD4B.5B0F7AE3@engrs.unl.edu>>:
> > ++ Hi! I am very new to perl. I have used it for writing a program that
> > ++ returns a two dimensional list. The problem is that the number of
> > ++ columns in that are variable according to the user input. When the # of
> > ++ columns are more than 5, the output that I get is getting wrapped and
> > ++ falling into the next line. This is spoiling the format of the output
> > ++ file. Please help me out if anyone knows a way of getting over this
> > ++ problem. I would really appreciate a detailed solution as I am very new
> > ++ to Perl.
> >
> > You could use a smaller font, or you put in the paper sideways.
> >
> > Abigail


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

Date: Thu, 07 Dec 2000 18:41:33 GMT
From: JL Goldstein <jgoldst@my-deja.com>
Subject: GD.pm constructor hangs
Message-Id: <90olkr$qvv$1@nnrp1.deja.com>

(crosspost from comp.lang.perl.moderated)

I am having a hell of a time with GD.pm, so I hope one of you gurus can
help me.

I have, according to the docs with GD.pm v. 1.32, installed the gd
graphics library (1.83), the PNG graphics library (1.08), and zlib
(1.13) as well as the JPEG library (6b).

After much wailing and gnashing of teeth, I can execute "perl -e 'use
GD' " without receiving an error. Example scripts from the GD.pm
distribution compile just fine.

However, when I attempt to create a new image either from scratch (as in
"my $im = new GD::Image(100,100)") or from a PNG file (as in "my $im =
new GD::newFromPNG($file)"), the script hangs.

As an example of the code that's giving me grief, I've included the
gd_example.cgi file included with the distribution, which is what I
tried first. TIA for any help anyone can provide.

===============================================
 #!/usr/local/bin/perl

use GD;

print "Content-type: image/png\n\n";

# create a new image
$im = new GD::Image(100,100);

# allocate some colors
$white = $im->colorAllocate(255,255,255);
$black = $im->colorAllocate(0,0,0);
$red = $im->colorAllocate(255,0,0);
$blue = $im->colorAllocate(0,0,255);

# make the background transparent and interlaced
$im->transparent($white);
$im->interlaced('true');

# Put a black frame around the picture
$im->rectangle(0,0,99,99,$black);

# Draw a blue oval
$im->arc(50,50,95,75,0,360,$blue);

# And fill it with red
$im->fill(50,50,$red);

binmode STDOUT;

# Convert the image to PNG and print it on standard output
print $im->png;

--
Anyone for Perl bowling?


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


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

Date: Thu, 07 Dec 2000 18:47:51 GMT
From: spam@s.patterson.freeuk.com (Stephen Patterson)
Subject: Re: Help - passing hash array into a subroutine
Message-Id: <rXQX5.24620$eT4.1853394@nnrp3.clara.net>

In article <X6wX5.23936$eT4.1564091@nnrp3.clara.net>, Stephen Patterson wrote:
>Is there a way to pass an entire hash array into a subroutine preserving the
>indexing in the hash?
>
>-- 
>If Patrick Henry thought that taxation without representation was bad,
>he should see how bad it is with representation.
>--	--	--	--	--	--	--	--	--	--
>Stephen Patterson	s.patterson@SPAMOFFfreeuk.com (Remove SPAMOFF to reply)

I've got it sorted, there was something in the FAQ, I just wasn't using it 
right at first.

-- 
To craunch a marmoset.
		-- Pedro Carolino, "English as She is Spoke"
--	--	--	--	--	--	--	--	--	--
Stephen Patterson	s.patterson@SPAMOFFfreeuk.com (Remove SPAMOFF to reply)


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

Date: 7 Dec 2000 17:09:44 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Help with HttpSniffer
Message-Id: <slrn92vh2o.734.abigail@tsathoggua.rlyeh.net>

On 07 Dec 2000 09:54:29 -0600, John Hunter (jdhunter@nitace.bsd.uchicago.edu) wrote in comp.lang.perl.misc <URL: news:<1r4s0gdy6i.fsf@video.bsd.uchicago.edu>>:
++ I am trying to use HttpSniffer to log the http headers in a dialog
++ between my browser and a remote server.
++ 


And your HttpSniffer problems have what to do with Perl?
(And in case your answer is: HttpSniffer is written in Perl, the reply
is: perl is written in C, hence you should ask in comp.lang.c)



Abigail


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

Date: 07 Dec 2000 11:59:55 -0600
From: John Hunter <jdhunter@nitace.bsd.uchicago.edu>
Subject: Re: Help with HttpSniffer
Message-Id: <1rpuj4cdt0.fsf@video.bsd.uchicago.edu>

>>>>> "Abigail" == Abigail  <abigail@foad.org> writes:

    Abigail> And your HttpSniffer problems have what to do with Perl?
    Abigail> (And in case your answer is: HttpSniffer is written in
    Abigail> Perl, the reply is: perl is written in C, hence you
    Abigail> should ask in comp.lang.c)

HttpSniffer is written in perl.  My guess is that people who know how
to use this program more are likely to read this group than, for
example, c.l.c.  Thus, I asked here because I thought I might find
people who know the answer and are willing to help.  I take it you
are not one of those people?

But if there is a more appropriate forum, I would be happy to ask it
there.  My news server has no groups which match http or proxy.  

John


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

Date: Thu, 07 Dec 2000 18:25:14 GMT
From: jb@yperite.demon.co.uk (Joe Broz)
Subject: Re: Help with HttpSniffer
Message-Id: <slrn92vl6j.93.jb@yperite.demon.co.uk>

On 07 Dec 2000 11:59:55 -0600, 
John Hunter <jdhunter@nitace.bsd.uchicago.edu> wrote:
>>>>>> "Abigail" == Abigail  <abigail@foad.org> writes:
>
>    Abigail> And your HttpSniffer problems have what to do with Perl?
>    Abigail> (And in case your answer is: HttpSniffer is written in
>    Abigail> Perl, the reply is: perl is written in C, hence you
>    Abigail> should ask in comp.lang.c)
>
>HttpSniffer is written in perl.  My guess is that people who know how
>to use this program more are likely to read this group than, for
>example, c.l.c.  Thus, I asked here because I thought I might find
>people who know the answer and are willing to help.  I take it you
>are not one of those people?
>
>But if there is a more appropriate forum, I would be happy to ask it
>there.  My news server has no groups which match http or proxy.  
>
>John

IMO neither group is appropriate. I would contact the author directly.




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

Date: 07 Dec 2000 13:21:36 -0500
From: Nevin Kapur <kapur@mts.jhu.edu>
Subject: Re: Help: How to read files from the end?
Message-Id: <m34s0gqehb.fsf@fermat.mts.jhu.edu>

Since no one pointed this out...

On Thu, 07 Dec 2000, nodo70@my-deja.com wrote:

> Try this:
> #!/usr/local/bin/perl -w
> open INFILE, "test.txt" || die "Cannot open test.txt";

This does not do what you think it does. Either use parentheses or
replace the '||' by 'or'.

[snipped rest of code]
-- 
Nevin


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

Date: Thu, 07 Dec 2000 17:55:56 GMT
From: jrogers42@hotmail.com
Subject: Help: storing metacharacters in a variable
Message-Id: <90oiv9$ofh$1@nnrp1.deja.com>

Thanks,
 If I let
            $string="\t"
how do I reference $string, so that it sees a tab and not \t?

Jason


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


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

Date: Thu, 07 Dec 2000 10:23:18 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Help: storing metacharacters in a variable
Message-Id: <3A2FD596.184EA360@vpservices.com>

jrogers42@hotmail.com wrote:
> 
>  If I let
>             $string="\t"
> how do I reference $string, so that it sees a tab and not \t?

What happens when you try this?

  my $string1 = "\t";
  my $string2 = 'baz' . $string1 . 'bop';
  print 'foo', $string1, 'bar', $string2;

What is there you want to know that the output of that test doesn't tell
you?

-- 
Jeff


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

Date: Thu, 07 Dec 2000 16:55:53 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: How can I access seconds since the epoch?
Message-Id: <3A2FB30A.45B90410@schaffhausen.de>

Stan Brown schrieb:
> 
>         I nned to do a check to see if a task has taken an inordinate ammount
>         of time. Seems to me an easy way to do this is capture teh seconds
>         since the epoch when it starts, and when it ends, and do a simple
>         subtraaction to get elapsed time.
> 
>         Question is, how can I easily obtain this value in perl?

Take a look at Benchmark.pm which is part of the standard distribution.

->malte


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

Date: 7 Dec 2000 17:11:02 GMT
From: abigail@foad.org (Abigail)
Subject: Re: How can I access seconds since the epoch?
Message-Id: <slrn92vh56.734.abigail@tsathoggua.rlyeh.net>

On 7 Dec 2000 06:42:00 -0500, Stan Brown (stanb@panix.com) wrote in comp.lang.perl.misc <URL: news:<90nt28$a1c$1@panix6.panix.com>>:
++ In <3a2f0493$1@news.cc.umr.edu> "LimboStar" <dontspamme@awdang.com> writes:
++ 
++ >"Stan Brown" <stanb@panix.com> wrote...
++ >>
++ >> Question is, how can I easily obtain this value in perl?
++ 
++ >I just answered this (or mentioned it, anyway) in another thread.
++ 
++ >time() returns the time in seconds since the epoch.
++ 
++ 
++ 	Ah, thanks you. I had overlooked this, and only found localtime()


But the documentation of locatime mentions time....



Abigail


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

Date: Thu, 07 Dec 2000 17:30:26 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: How to Exit from Inner Loop ???
Message-Id: <3A2FBB22.82CDA3B8@fujitsu-siemens.com>

Josef Moellers wrote:
> =

> cwang9@yahoo.com wrote:
> >
> > I have 2 while loop and one is as an inner loop.
> >
> > Just could not find a way to exit the inner loop and
> > start the next round of outer one. Some function like
> > 'continue' in C/C++ I am looking for.
> >
> > I checked 2 Perl books I have so far,,,
> =

> ... but haven't found "next"!

Slap slap ... should have been "last" Ohboy, shame on me!

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize (T.  Pratchett)


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

Date: Thu, 07 Dec 2000 13:01:09 -0500
From: Jonathan Kuhn <jonathan.kuhn@gsfc.nasa.gov>
Subject: how to get DOS 8.3 current directory
Message-Id: <3A2FD065.DE8EE0E3@gsfc.nasa.gov>

Hello,

I am running active perl under windows 2000. I can get the current
working directory using the Cwd library and the cwd() command. However,
we are interfacing with a program that has problems with spaces in
directory names.

How can I get the current working directory with everything DOS 8.3
formatted?

Could you please CC to jonathan.kuhn@gsfc.nasa.gov? Thanks.

Jonathan


-- 
  Dr. Jonathan Kuhn
  Mechanical Systems Analysis and Simulation Branch
  NASA Goddard Space Flight Center 
  Greenbelt, MD 20771

  (301) 286-4278
  jonathan.kuhn@gsfc.nasa.gov
  http://analyst.gsfc.nasa.gov/jkuhn


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

Date: 7 Dec 2000 17:15:36 GMT
From: abigail@foad.org (Abigail)
Subject: Re: How to insert Perl Code inside E-mail text?
Message-Id: <slrn92vhdo.734.abigail@tsathoggua.rlyeh.net>

On Wed, 6 Dec 2000 20:06:44 GMT, Amine Laghaout (alaghaout@trentu.ca) wrote in comp.lang.perl.misc <URL: news:<3A2E9C54.668480FB@trentu.ca>>:
++ Hi everyone,
++ 
++ I have a dumb question:
++ 
++ I have an e-mailing program which works this way:
++ ------------------------------------------
++      open(MAIL, "|$MAIL_PROG");
++ print MAIL <<"(END MAIL)";
++ From: someone\@trentu.ca
++ To: $instruct_mail
++ Subject: Subject
++ Reply-To: someone\@trentu.ca
++ 
++ BLABLABLA, here goes the message...
++ 
++ 
++ (END MAIL)
++ 	close MAIL;
++ ------------------------------------------
++ 
++ Here is what I would like to do: write a while loop inside the BLABLA
++ message to print out a list stored in a *.csv file. It does not
++ work... Is there another way to have some Perl code inside there? 

   print MAIL <<"(END MAIL)";
   From: someone\@trentu.ca
   To: $instruct_mail
   Subject: Subject
   Reply-To: someone\@trentu.ca
   
   ${\`cat *.csv`}, here goes the message...
   
   
   (END MAIL)



Abigail


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

Date: Thu, 7 Dec 2000 18:38:10 -0000
From: "Bert Tibergijn" <bert.tibergijn@skynet.be>
Subject: html source ->>> text-file
Message-Id: <90ohn1$3t0$1@news0.skynet.be>

I'm looking for a script that accepts a URL and saves the HTML-source code
of the URL-page into a txt-file.






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

Date: Thu, 07 Dec 2000 16:54:59 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Interrupting HTML output
Message-Id: <3A2FB2D4.5FB0CCD6@schaffhausen.de>

Bill Brandt schrieb:
> 
> Hi folks,
> 
> I'm developing a Perl CGI script that does analysis on a database. The problem
> I'm running into is that when submitting larger queries, the process usually
> takes longer than 5 minutes to return. Since both IE and Netscape will timeout
> after 5 minutes, I need a way to either 1) interrupt the output coming
> back--render the updates--then continue, or 2) throw some progress indicator
> back at the browser until the server cranks out the output.
> 
> While it's possible to hack the registry entry of the browser to broaden the
> timeout, I can't expect our users to do such.
> 
> I'm running from an Apache server so server-side javascript is out. There
> appears to be an Apache module that might do the trick but I'm still
> investigating that.
> 
> If anyone has javascript/html suggestions, please let me know. Thanks.

I think a multipart output would work. You first send a message like
"please wait for the output..." and if the output appears the message is replaced.

Look at the output of a query @ bugzilla.mozilla.org for a live example.
I'm sorry I cant give you a code example, but you should find some at
the various
search engines.

Bye,
->malte


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

Date: 7 Dec 2000 17:20:21 GMT
From: abigail@foad.org (Abigail)
Subject: Re: Linked lists
Message-Id: <slrn92vhml.734.abigail@tsathoggua.rlyeh.net>

On Thu, 07 Dec 2000 11:56:58 GMT, Koen Verbeke (Koen@Verbeke.net) wrote in comp.lang.perl.misc <URL: news:<Pine.LNX.4.21.0012071358000.2685-100000@anfalas.middle-earth>>:
++ 
++ Can someone give me an example of a linked list and tell me the story
++ behind it?


You should be consulting a text book about data structures, not a newsgroup
about a language.


Abigail


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

Date: Thu, 07 Dec 2000 16:52:00 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: MAC + Unix + Win2000
Message-Id: <3A2FB220.193E3BF6@schaffhausen.de>

Hi,

I'm kind of embarrassed about this question but I'm really
desparate, too, so here it is:

We have a customer which is about 200 km away. We do not have
a ftp connection to their server. So if I need to change a Perl
script I send it via eMail and their sys-admin puts it onto
server. This works...sometimes..but, occasionally, one of those files
creates a "blabla did not return a true value at blabla".

It looks like perl requires only the first byte or no bytes at all
because:
- the file definetly does return a true value
- if it would stop someehre in the middle I guess there'd be something
  like a "missing right bracket" error

Resending the file doesnt help. The error keeps appearing.
As a result I have to drive to the customer and do the changes mannually.

The files are created on a Mac, stored on a Linux/RedHat server,
and run on a Windows2000 server. I'm writing this because I guess
it might have to something with line breaks or some system
depending thing.

I hope somebody here has a transfer-method which will work in this case,
maybe I should say that everything works fine on our local server.

Thanx,
->malte


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

Date: Thu, 07 Dec 2000 16:02:29 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: Making Perl output window on NT scrollable.
Message-Id: <90ocaf$iao$1@nnrp1.deja.com>


> The next time you start CMD.EXE you will be able to scroll 100 lines
back
> using the scroll bar on the right side.
>
> I use the same trick :)
Yes, the dos-box has a scrollbar now.
But you can't scroll in fullscreen ... or is there a way to get that
working, too??


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


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

Date: Thu, 07 Dec 2000 17:23:28 GMT
From: Olivier Dupouy <olivier@aersoft.com>
Subject: MIME::Lite message bounced by receiver server
Message-Id: <3A2FC881.BD66C595@aersoft.com>

I am using MIME::Lite to send messages. That wotks pretty well exept
when I send it to special email addresses where the server is checking
the sender id.
In the mail I am sending, Lite fill the field Return-path by
myusername@mymachine :   Return-path: olivier@mars  --> mars is my
machine
It should fill it by olivier@aersoft.ie, what can I do to do this??

That's the kind of messages the receiver demon reply me:

Your message cannot be delivered to the following recipients:
  Recipient address: friend@host1.com
  Reason: Remote SMTP server has rejected address
  Diagnostic code: smtp; 504 <olivier@mars>: Sender address rejected:
need fully-qualified address

or

Your message cannot be delivered to the following recipients:
  Recipient address: friend@host2.com
  Reason: Message rejected; bad return address.
  Diagnostic code: smtp; 501 <olivier@mars>... Sender domain must exist

Thinks for the help

Olivier



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

Date: Thu, 07 Dec 2000 16:26:25 GMT
From: ken_shih@my-deja.com
Subject: Net::SMTP->quit() ... does it really close socket conn?
Message-Id: <90odn6$jke$1@nnrp1.deja.com>

Hi,
wondering if anyone found this problem & found a solution...

The Net::SMTP doc says that "quit()" should "Send the QUIT command to
the remote SMTP server and close the socket connection".  I have found
this not to be the case.  That is if i do "netstat -n | grep
209.83.171", for example, on my server.  I get a
"tcp4 0 0 192.168.100.67.80 209.83.171.129.52435 TIME_WAIT" which
closes in 90 seconds AFTER the script has run.  Does anyone know how to
close this baby besides "quit()" or if there the a patch etc?

I enclose a sample of what my script snippet kinda looks like....

    use Net::SMTP;
    $smtp = Net::SMTP->new('mailhost');

    $smtp->mail($ENV{USER});
    $smtp->to('postmaster');

    $smtp->data();
    $smtp->datasend("To: postmaster\n");
    $smtp->datasend("\n");
    $smtp->datasend("A simple test message\n");
    $smtp->dataend();

    $smtp->quit;
    undef $smtp;

Thanks for your help!
ken


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


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

Date: Thu, 7 Dec 2000 12:35:11 -0600
From: "T Hawk" <support@REMOVEdotmatrix.net>
Subject: Re: Perl SQL Array
Message-Id: <t2vmeapmcqlt3f@corp.supernews.com>

Thanks guys! Worked like a charm!
"LimboStar" <dontspamme@awdang.com> wrote in message
news:3a2f0447@news.cc.umr.edu...
> "Jeff Zucker" <jeff@vpservices.com> wrote...
> >
> > I assume you are using DBI, if not, you should be.  With DBI, it's done
> > like this:
>
> Ooh, I learn something new every day.  I knew there was a reason I stuck
> around.
>
> --sjd;
>
>




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

Date: Thu, 07 Dec 2000 08:34:56 -0700
From: Daryl Habersetzer <dhabersetzer@micron.com>
Subject: Re: Regular expression question
Message-Id: <3A2FAE20.445E17B3@micron.com>

Matthew Lechner wrote:
> 
> Hello, how can I construct a regular expression to solve the following
> problem:
> 
> Given the following sentence:
> 
> The dog was dog tired.
> 
> How can I match "dog" only when it is not part of the phrase "dog
> tired"?  Thanks for your help.

man perlre

     (?!pattern)
               A zero-width negative lookahead assertion.  For
               example /foo(?!bar)/ matches any occurrence of
               "foo" that isn't followed by "bar".  Note however
               that lookahead and lookbehind are NOT the same
               thing.  You cannot use this for lookbehind.

               If you are looking for a "bar" that isn't preceded
               by a "foo", /(?!foo)bar/ will not do what you
               want.  That's because the (?!foo) is just saying
               that the next thing cannot be "foo"--and it's not,
               it's a "bar", so "foobar" will match.  You would
               have to do something like /(?!foo)...bar/ for
               that.   We say "like" because there's the case of
               your "bar" not having three characters before it.
               You could cover that this way:
               /(?:(?!foo)...|^.{0,2})bar/.  Sometimes it's still
               easier just to say:

                   if (/bar/ && $` !~ /foo$/)


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

Date: 7 Dec 2000 16:13:05 GMT
From: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>
Subject: Re: Running gnuplot from a script
Message-Id: <90ocuh$ro6$1@nets3.rz.RWTH-Aachen.DE>

In comp.graphics.apps.gnuplot M.I. Planchant <M.I.Planchant@ncl.ac.uk> wrote:
> How do I go about running gnuplot from a perl script? I have a file which
> contains data which when given the command :

> gnuplot <filename> 

I don't know Perl that well, but something like

	system ("gnuplot $FILENAME")

might already do it. Extra flexibility is gained by opening a command pipe
from your Perl script to gnuplot, and sending it commands individually.
That way, you can modify the commands on-the-fly.
-- 
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.


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

Date: Thu, 07 Dec 2000 16:47:47 GMT
From: Adam Levenstein <cleon42@my-deja.com>
Subject: Using stat to get last mod.time
Message-Id: <90oevh$kog$1@nnrp1.deja.com>

Hey all,

My two lines read like this:

($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks
= stat('/tmp/lock.content');
($fsec,$fmin,$fhour,$fmday,$fmon,$fyear,$fwday,$fyday,$fisdst) = $mtime;


Now, the simple question with the long answer - why doesn't this work?
$fsec returns a value, but nothing else ($fmin,$fhour, etc.) does.


I appreciate the help,

Adam

--
-------------------------------------------------
Adam Levenstein
cleon42@my-deja.com

"Extraordinary claims require extraordinary evidence."
				-- Carl Sagan


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


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

Date: Thu, 07 Dec 2000 16:05:27 GMT
From: rysmiel@my-deja.com
Subject: Win32::ODBC/MSAccess query
Message-Id: <90ocg3$ie8$1@nnrp1.deja.com>

Is it possible to call an existing queryin an MSAccess database from a
perl script using Win32::ODBC, and if so what is the format ?

Thanks in advance,

E


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


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

Date: Thu, 07 Dec 2000 17:00:38 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Yesterdays Date
Message-Id: <3A2FB427.EA79AC38@schaffhausen.de>

Bjoern Kaiser schrieb:
> 
> Hi
> 
> (my $day,my $month,my $year) = (localtime(time))[3,4,5];
> gives me todays date but what's the most simple way to get yesterdays date
> in the same format?
> 
> thx

use Date::Calc qw[Add_Delta_Days Today];
($year, $month, $day) = Add_Delta_Days(Today(),-1);

 ...but there is more than one way to do it, especially if you do not
want to install Date::Calc

->malte


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

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


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