[18459] in Perl-Users-Digest
Perl-Users Digest, Issue: 627 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 4 14:05:52 2001
Date: Wed, 4 Apr 2001 11:05:23 -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: <986407522-v10-i627@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 4 Apr 2001 Volume: 10 Number: 627
Today's topics:
$word$ literal in a .pl? <wbn1@qNowesspamt.net>
Re: $word$ literal in a .pl? <wuerz@yahoo.com>
Re: 'Use'ing shared objects <ubl@schaffhausen.de>
a question about * (=?iso-8859-1?Q?=B8=DF=C3=F7?=)
Re: a question about * (Tad McClellan)
Re: Adding hours to pre-defined date HOW <ubl@schaffhausen.de>
ANNOUNCE: CGI::SSI v0.01 <Ave.Wrigley@itn.co.uk>
Re: Best way to save HTML form data to XML <lancelot@inetnebr.com>
boot_foo__bar setting in XS->C yacob@nospam.com
Bulk renaming files <lmoran@wtsg.com>
Re: Bulk renaming files <gus@black.hole-in-the.net>
Re: Bulk renaming files nobull@mail.com
Bytecode (Mark Warnes)
Re: Deleting one line from a file <juex@deja.com>
Re: Difference between $! and $@ (Mark Jason Dominus)
Re: Force Integer Division?? <wayne.keenan@ntlworld.com>
Re: Funny behavior? <bcoon@sequenom.com>
grepping while tailing <achatz@forthnet.gr>
Re: help needed with sorting Hash <uri@sysarch.com>
Image Reloading?! <bcoon@sequenom.com>
Re: lines with headers kenta@nospam.nospam
Re: Multiple email send?vvp <webmaster@webdragon.unmunge.net>
NET::SMTP module problems <alan@scotlpuk.com>
Re: NET::SMTP module problems <Peter.Dintelmann@dresdner-bank.com>
Perl File Converter using all available memory. <thollowe@opentext.com>
Re: Perl File Converter using all available memory. nobull@mail.com
Re: Perl Timer! <bernie@fantasyfarm.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 4 Apr 2001 10:17:25 -0700
From: "Bruce N. Wheelock" <wbn1@qNowesspamt.net>
Subject: $word$ literal in a .pl?
Message-Id: <GGIy6.1749$uk.203949@news.uswest.net>
I need to include the literal string "$word$" within a .pl file. It can't be
a string that's read from a file at run time--it must be present. In
addition, the trailing $ can't be escaped. In short, the following line must
appear in the .pl file:
$key = "$word$";
I cannot find a way to convince Perl to accept this and not just fail on a
syntax error when the script is run. Suggestions, anyone?
--
/Bruce/
------------------------------
Date: Wed, 04 Apr 2001 19:23:00 +0200
From: Mona Wuerz <wuerz@yahoo.com>
Subject: Re: $word$ literal in a .pl?
Message-Id: <040420011923007010%wuerz@yahoo.com>
<wbn1@qNowesspamt.net> wrote:
> I need to include the literal string "$word$" within a .pl file. It can't be
> $key = "$word$";
> Suggestions, anyone?
$key = '$word$';
perldoc perlop
-mona
------------------------------
Date: Wed, 04 Apr 2001 15:03:14 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: 'Use'ing shared objects
Message-Id: <3ACB29A2.37D97EAC@schaffhausen.de>
Robert Jones schrieb:
>
> I'm trying to make use of the perlcc 'compiler' to create shared
> objects and the 'use' them in wrapper scripts in order to cut down on
> interpretation time but I can't get it to work and the FAQs don't
> help.
>
> Does anyone know how to use a shared object file within a script?
> Which module(s) do I need to read them in?
As I read the FAQ you wont't neccessarily get improved performance from this.
I suggest you use XS or Inline to use external C libraries if you want speed.
->malte
------------------------------
Date: Wed, 04 Apr 2001 21:59:11 +0800
From: Remington Gao (=?iso-8859-1?Q?=B8=DF=C3=F7?=) <pangpang@writeme.com>
Subject: a question about *
Message-Id: <3ACB28AE.1FA3152A@writeme.com>
Hi,
I have a question when i study some code, there's some lines below:
sub ReadParse {
local (*in) = @_ if @_;
......
Could you please tell me what the * mark means?
Thanks :-)
Remington
------------------------------
Date: Wed, 4 Apr 2001 10:56:37 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: a question about *
Message-Id: <slrn9cmdh5.gi4.tadmc@tadmc26.august.net>
Remington Gao (¸ßÃ÷) <pangpang@writeme.com> wrote:
>
>I have a question when i study some code, there's some lines below:
>
>sub ReadParse {
> local (*in) = @_ if @_;
> ......
>
>Could you please tell me what the * mark means?
It is called a "typeglob" documented in the "Typeglobs and Filehandles"
section:
perldoc perldata
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 04 Apr 2001 15:50:21 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: Adding hours to pre-defined date HOW
Message-Id: <3ACB34AD.6A865A06@schaffhausen.de>
MAC schrieb:
>
> I have a problem to be solved, i would like a routine thats adds hours/days
> to a pre-defined date and time. I have something that works but ONLY on a
> local current time like this:
>
> use constant SECONDS_PER_DAY => 60 * 60 * 24;
> my $tomorrow = localtime( time + SECONDS_PER_DAY );
> print "Tomorrow's date is $tomorrow\n";
>
> The thing is, i need to parse to this routine, a newdate and time, and to
> THAT date adding hours and/or days something like this:
>
> DD M YEAR H M S, HOURS TO ADD
> ReturnNewDate(01.01.2001.23.15.0,10);
>
> This parses the date: 1 jan 2001 23:15:0 and ADDS 10 hours to it.
>
> Returns: $found= "02.01.2001.9.15.0"; ( 2 jan 2001 9:15:0)
>
> Can someone help me with this ?
Check for Date::*, I'd recommend Date::Calc on CPAN.
->malte
------------------------------
Date: Wed, 4 Apr 2001 18:29:25 +0100
From: "Ave Wrigley" <Ave.Wrigley@itn.co.uk>
Subject: ANNOUNCE: CGI::SSI v0.01
Message-Id: <tcmm0e7tf1id49@corp.supernews.com>
CGI::SSI is a module which does standard SSI processing on HTML files. It is
intended to be used in CGIs, where the output of the CGI is HTML that
included SSI directives, but where SSI processing is not being done on this
output by the webserver.
use CGI::SSI qw( ssi get_content );
CGI::SSI::allow_exec = 1;
print ssi( $html );
print ssi( get_content( $filename ) );
It should be available through CPAN. It is a fairly simple module at
present; comments and suggestions welcome.
------------------------------
Date: Wed, 04 Apr 2001 08:43:34 -0500
From: Lance Dyas <lancelot@inetnebr.com>
Subject: Re: Best way to save HTML form data to XML
Message-Id: <3ACB2506.DF903D1@inetnebr.com>
one possibility is write the xml with javascript client side....
xparse is a concise javascript [not java] under 10kb not compressed
which manages conformally writing xml 1.0
could be stuck in a jar to get it even lighter.
Can you say reduced server load... I thought you could.
Eric Bohlman wrote:
>
> In comp.text.xml Lucient Chan <lucie@sinden.nccom.com> wrote:
> > I'm reading data from a HTML page which contains a form, and I'm trying
> > to write the user-entered data in the form to a XML file. Can anyone
> > tell me the best way to accomplish this?? Does any of the perl modules
> > such as XML::DOM provide an API to create a XML document??
>
> While you can indeed use XML::DOM, it's a bit heavyweight for this
> purpose. I'd be more inclined to suggest XML::Writer, or XML::Generator
> (especially if you're used to using the HTML-generating function in
> CGI.pm, as it works similarly). XML::Simple, XML::XPath, XML::Twig,
> XML::Handler::YAWriter, and others also have generation facilities, though
> they might be overkill.
>
> Finally, while *reading* XML without the help of a module is ill-advised,
> *writing* it with print statements is possible, as long as you deal
> escaping and character-encoding issues yourself.
--
*****************************************************************
Dragonlord Garthans - Decision Driven Gaming - Role Play center
http://incolor.inetnebr.com/lancelot/roleplay
Want custom art for your RPG characters?
*****************************************************************
------------------------------
Date: 4 Apr 2001 17:10:35 GMT
From: yacob@nospam.com
Subject: boot_foo__bar setting in XS->C
Message-Id: <9afkib37mb@news2.newsguy.com>
Greetings,
I've encountered a problem where the boot strapper created for an XS
module is not being named properly. My directory structure follows:
dir/foo.xs
dir/bar/bar.xs
there is a Makefile.PL in each which sets them module name with the
"NAME" parameter to WriteMakefile correctly. However, in "bar.c" I
find XS(boot_foo) where XS(boot_foo__bar) is expected.
What determines the name here and how can I make sure it comes out
right?
any help appreciated,
thanks,
/Daniel
==================================
Posted via http://nodevice.com
Linux Programmer's Site
------------------------------
Date: Wed, 04 Apr 2001 12:23:35 -0400
From: Lou Moran <lmoran@wtsg.com>
Subject: Bulk renaming files
Message-Id: <5ahmct8ogh84jet92ppk7muaefaouh6t8t@4ax.com>
-Have a user on W32 who names her files:
somename.doc.001
somename.doc.002
etc
-Unable to get her to change this bizarre habit nor can I get her to
stop complaining that her computer doesn't work b/c Word cannot find
her files.
-So I went to the Cookbook snagged this happy little script from p.
326:
foreach $file (@NAMES) {
my $newname = $file;
rename ($file, $newname) or
warn "Can't rename $file to $newname: \n\n";
}
redid it to ask questions and such BUT what I'd like is for the script
to auto-increment the file name like so:
somename001.doc
somename002.doc
etc
-I know how to auto-increment numbers (++) but this method is
producing results that are unexpected to me.
ex:
#!/usr/bin/local/perl -w
use strict;
print "Name: ";
my $name = <STDIN>;
chomp $name;
$name++;
print "$name";
changes ABC to ABD. I had sort of envisioned it do this:
ABC to ABC1
-So basically I have no idea how I am going to get:
somename.doc.001 to somename001.doc
without a lot of questions to the user.
any ideas or perldocs appreciated
--
print "\x{263a}"
------------------------------
Date: Wed, 04 Apr 2001 16:54:51 GMT
From: Gus <gus@black.hole-in-the.net>
Subject: Re: Bulk renaming files
Message-Id: <986403291.2664.0.nnrp-09.c29f015a@news.demon.co.uk>
Lou Moran <lmoran@wtsg.com> wrote:
> -So basically I have no idea how I am going to get:
> somename.doc.001 to somename001.doc
> without a lot of questions to the user.
Just a thought, but ...
foreach $file (@ARGV) {
# Only match files ending in "." plus 3 digits
next unless ($file =~ /\.(\d\d\d)$/);
print STDERR "$file becomes ";
# $+ is last matched pattern
substr($file,index($file,".")) = $+ . ".doc";
print STDERR $file,"\n";
}
Of course, you'd have to add in renaming, checking it's a .doc etc.
--
gus@black.hole-in-the.net
0x58E18C6D
82 AA 4D 7F D8 45 58 05 6D 1B 1A 72 1E DB 31 B5
http://black.hole-in-the.net/gus/
------------------------------
Date: 04 Apr 2001 18:32:10 +0100
From: nobull@mail.com
Subject: Re: Bulk renaming files
Message-Id: <u9k850sh9h.fsf@wcl-l.bham.ac.uk>
Lou Moran <lmoran@wtsg.com> writes:
> -Have a user on W32 who names her files:
> somename.doc.001
> somename.doc.002
>
> foreach $file (@NAMES) {
> my $newname = $file;
> rename ($file, $newname) or
> warn "Can't rename $file to $newname: \n\n";
> }
>
> redid it to ask questions and such BUT what I'd like is for the script
> to auto-increment the file name like so:
>
> somename001.doc
> somename002.doc
(my $newname = $file) =~ s/\.doc\.(\d+)$/$1.doc/;
> -I know how to auto-increment numbers (++) but this method is
> producing results that are unexpected to me.
Huh? What's with the sudden change of topic? Where does
auto-increment fit in?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 04 Apr 2001 13:50:03 GMT
From: mark.warnes@limecs.com (Mark Warnes)
Subject: Bytecode
Message-Id: <3acb2632.24298409@news.firstnet.co.uk>
Has anyone tried using perl bytecode before?
I can 'compile' my script to bytecode easily enough but I then can't
seem to bring it back in and use it. Is there a module I should be
using to perform this little trick?
Mark
------------------------------
Date: Wed, 4 Apr 2001 09:33:56 -0700
From: "Jürgen Exner" <juex@deja.com>
Subject: Re: Deleting one line from a file
Message-Id: <3acb4cfd@news.microsoft.com>
"David Findlay" <david_j_findlay@yahoo.com.au> wrote in message
news:hCuy6.8621$45.50833@newsfeeds.bigpond.com...
> > Here's a quickie for you, if you promise to read the FAQ:
> > while(<>) { print unless /what I don't want matched/ }
>
> So can I go
>
> while(<FILE>) { print unless @array }
>
> Where array contains an array of the values I want to remove.
You are so way off, I don't even know where to start.
- do you know what "unless" does (it's a sort of reverted "if")?
- do you realize that the part after the "unless" is the condition? In the
example presented to you it was a pattern match "/foo/" (note the
slashes!!!).
- of course you can replace the condition with whatever you want, but
evaluating an array in a scalar context (in this case boolean context) will
yield the number of elements in the array (in this case "true" unless the
array is empty). Is that what you want?
You will have to re-formulate the condition to match your needs.
jue
------------------------------
Date: Wed, 04 Apr 2001 15:10:13 GMT
From: mjd@plover.com (Mark Jason Dominus)
Subject: Re: Difference between $! and $@
Message-Id: <3acb3955.695e$24d@news.op.net>
Keywords: Crusoe, nose, riverside, sibling
In article <13Ay6.1267$jz.109482@www.newsranger.com>,
Chandramohan Neelakantan <cmon_209@hotmail.com> wrote:
>For e.g we check $@ for exception handling and $! is used for errors in Signal
>handling.
$! is set by the OS when an OS error occurs, typically by file
functions like 'open', 'rename', 'unlink', 'chdir', and so on; and by
process control functions like 'fork', 'exec', and 'kill'.
$@ is set by Perl when code executed by the 'eval' function would have
aborted with a fatal error.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f^ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Wed, 04 Apr 2001 17:52:57 +0100
From: "wayne.keenan" <wayne.keenan@ntlworld.com>
Subject: Re: Force Integer Division??
Message-Id: <3ACB5168.31564C54@ntlworld.com>
> > I read that a division of two integers should produce an integer
> > answer but that isn't true on my computer.
> >
> > 12/10 = 1.2
> >
>
> Will "use integer" do it?
yes
------------------------------
Date: Wed, 04 Apr 2001 10:03:38 -0700
From: Bryan Coon <bcoon@sequenom.com>
Subject: Re: Funny behavior?
Message-Id: <3ACB53EA.296ED132@sequenom.com>
Jim Britain wrote:
> [posted and mailed]
> On Mon, 02 Apr 2001 10:07:03 -0700, Bryan Coon <bcoon@sequenom.com>
> wrote:
>
> >It is probably fair to say that 95% or more of what people ask here is in
> >some documentation somewhere. So in that respect, most people should
> >RTFM, or check the faq, etc. But for some (including myself) of us who
> >are embedded in the learning curve of perl, there are of course a
> >gazillion things we dont know. For example, I had no idea that 'perldoc
> >-q '<<'' was the answer to my question. Perhaps it was obvious to
> >everyone else out there, but not me.
> >
> >So in this case how am I 'supposed to check the faq'? Chris's response
> >was very helpful, and I appreciate that. But telling me that I am
> >supposed to check the faq, when in essense the questiion is how to find
> >this in the faq is not helpful. Clearly, if I had known how to find it
> >in the faq, I would not have posted it.
>
> The FAQ for a newsgroup, language, activity, program, application.
> is like "Clift's Notes".
>
> Probably the worst answer for anyone who doesn't know about the FAQ
> (it is properly capitalized) is perldoc -q "HERE DOCS", or whatever.
>
> A newcomer needs to PRINT OUT ON REAL PAPER. The FAQ, and staple it
> together for reference.
>
> It should be the FIRST paper reference document, and the first
> consulted..
>
> That's the part that most are missing.
>
> Print the flippin thing!! Read the flippin thing, take notes.
>
> perldoc -q is a very idiotic way to search the FAQ if you are not
> familiar with it.
>
> You'll learn a whole lot more turning the pages.
>
> Print it out. Stuff it in your pocket. Use it in the bathroom, take
> it on your first date. Lay it beside your monitor.
>
> It's cheaper than the manual.
I agree completely! I haven't had the distinctly uncomfortable urge to take
my huge stack of printed out docs to the bathroom yet. I would imagine this
could only generate more frustration, but I haven't checked the FAQ on that.
:)
Bryan
------------------------------
Date: Wed, 04 Apr 2001 19:43:44 +0300
From: Tassos Chatzithomaoglou <achatz@forthnet.gr>
Subject: grepping while tailing
Message-Id: <3ACB4F40.E93D202C@forthnet.gr>
How is it possible to do the following in perl?
A syslogd is used to create the file.log. Then i do :
tail -f file.log
and while the file is printed on screen, i want to get each line "grepped" through some strings
and sent to different files.
--
***************************
Chatzithomaoglou Anastasios
Network Operations Center
FORTHnet S.A.
<achatz@forthnet.gr>
***************************
------------------------------
Date: Wed, 04 Apr 2001 14:51:45 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: help needed with sorting Hash
Message-Id: <x7bsqcu39n.fsf@home.sysarch.com>
>>>>> "DL" == Derek Ludwig <derek@ludwig.com> writes:
DL> Reverse the key/values:
DL> %hash (7 => a, 1 => b, 3 => c)
DL> and print the "value" first. You would have to work out a means
DL> of handling multiple keys with the same value, either with a list
DL> or some sort of string.
bleh! that is a horrible solution. it still doesn't tell him how to sort
even by the keys. and you just added the complexity of dealing with
multiple values mapping to the same key and didn't show him how to do
that.
the FAQ answer covers the OP question just fine. why didn't you let him
know that or let others tell him?
comp.lang.perl removed as it is not a real group
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Learn Advanced Object Oriented Perl from Damian Conway - Boston, July 10-11
Class and Registration info: http://www.sysarch.com/perl/OOP_class.html
------------------------------
Date: Wed, 04 Apr 2001 10:22:51 -0700
From: Bryan Coon <bcoon@sequenom.com>
Subject: Image Reloading?!
Message-Id: <3ACB586B.39D8113C@sequenom.com>
This seems absurd. What the heck do you have to do to prevent an image
from reloading from cache? I cannot (for other reasons in my
program) use the <img src=imagegenerator.cgi?foo=$somerand> tag.
The header method in CGI.pm supposedly has the capability to prevent
this, but I have not found any combination of -expires, -pragma settings
which guarantee that images will be reloaded fresh, rather than from
cache.
Here's my header:
~~~snip~~~
print header(-expires => '+0s');
~~~snip~~~
I have seen in some usenet posts a -pragma tag for no-cache and such,
but it doesn't seem to be in the cgi.pm docs as an accepted parameter...
I have scoured the usenet, read the FAQ, checked the CGI.pm docs... and
nothing. I would have thought for such a problem there would be a
simple (hopefully browser independent) solution, but I cant find it.
Can anyone help?
------------------------------
Date: 4 Apr 2001 17:59:03 GMT
From: kenta@nospam.nospam
Subject: Re: lines with headers
Message-Id: <9afnd7$114$1@news.netmar.com>
In article <3abfecf2.147251611@news.erols.com>, Jay Tilton
<tiltonj@erols.com> writes:
>On 26 Mar 2001 03:07:45 GMT, kenta@nospam.nospam wrote:
>
>>#!perl -w
>>$first_time=1;
>>while(<>){
>> chomp;
>> unless (/^\d*$/){
>> print "$title=$sum\n" unless $first_time;
>> $title=$_;
>> $first_time=0;
>> $sum=0;
>> next;
>> }
>> $sum+=$_;
>>}
>>print "$title=$sum\n" unless $first_time;
>
>>So, is there anyway to avoid duplicating the "print"
>>statement at the end?
[a valid hash-based approach snipped because it eats
too much memory]
>
>Or you can invert some of the flow control.
>
> my ($title, $sum);
> do {
> while (<>) {
> chomp;
> last unless /^\d*$/;
> $sum += $_;
> }
> print "$title=$sum\n" if defined $title;
> $title = $_;
> $sum = 0;
> } until eof
This seems to work, but is it actually correct? It seems
to me that we exit out of the while(<>) loop upon the
first detection of EOF, and then calling the "eof" function
again is not kosher.
Quoth 'man perlfunc':
Do not read from a terminal file (or call `eof(FILEHANDLE)'
on it) after end-of-file is reached.
Also, is there a way to do it without using "eof"?
Quoth 'man perlfunc':
Practical hint: you almost never need to use `eof'
in Perl,
Answering my own question yields:
while(!$eof){
$eof=1;
while (<>) {
chomp;
unless (/^\d*$/) {
$eof=0;
last;
}
$sum += $_;
}
print "$title=$sum\n" if defined $title;
$title = $_;
$sum = 0;
}
But this still seems inelegant to me. (Though
definitely an improvement over the original.)
Is it possible to have just a single loop,
i.e, "while(<>)" as the only looping
construct?
--k
----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web -----
http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
NewsOne.Net prohibits users from posting spam. If this or other posts
made through NewsOne.Net violate posting guidelines, email abuse@newsone.net
------------------------------
Date: 4 Apr 2001 14:01:28 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: Multiple email send?vvp
Message-Id: <9af9fo$l9c$1@216.155.32.173>
In article <9aeqfc$o3$1@bcarh8ab.ca.nortel.com>,
"Prasad, Victor [FITZ:K500:EXCH]" <vprasad@americasm01.nt.com> wrote:
| I have a list of 20 000 people who a monthly email.
Wouldn't it make more sense to set up a Mailing List server like
Majordomo or Listserv?
--
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw";
# ( damn spammers. *shakes fist* take a hint. =:P )
------------------------------
Date: Wed, 4 Apr 2001 16:12:58 +0100
From: "Alan Fleming" <alan@scotlpuk.com>
Subject: NET::SMTP module problems
Message-Id: <oOGy6.876$%W5.107851@news6-win.server.ntlworld.com>
Hi. I was using a script which needed this module to send email, and it
worked fine. However, i needed to re-install my NT server software, and so
perl was lost. When I installed the same version (5.004 I think, and the
only copy I have) with the same modules, it tells me it cannot find the
module net::config. I checked the smpt module, and sure enough, it called
this module. I can't find it anywhere, and I do not remember installing
this at any time in the past. Is it just a fluke that it worked before, or
had I accidentally installed it previously?
Anyway, I really need this module, FAST, 'cos my clients are getting miffed
by my lack of software for them! :p
If anybody could reply to me personally (I'll be too busy to check this
forum again soon) with either info on where to get this module, or a copy of
it, I'd be very greatful.
Thanks in advance,
Alan
------------------------------
Date: Wed, 4 Apr 2001 18:00:39 +0200
From: "Dr. Peter Dintelmann" <Peter.Dintelmann@dresdner-bank.com>
Subject: Re: NET::SMTP module problems
Message-Id: <9afg46$m8h9@news-1.bank.dresdner.net>
Hi,
"Alan Fleming" <alan@scotlpuk.com> wrote in message
news:oOGy6.876$%W5.107851@news6-win.server.ntlworld.com...
> Hi. I was using a script which needed this module to send email, and it
> worked fine. However, i needed to re-install my NT server software, and
so
> perl was lost. When I installed the same version (5.004 I think, and the
> only copy I have) with the same modules, it tells me it cannot find the
> module net::config. I checked the smpt module, and sure enough, it called
> this module. I can't find it anywhere, and I do not remember installing
> this at any time in the past. Is it just a fluke that it worked before,
or
> had I accidentally installed it previously?
>
> Anyway, I really need this module, FAST, 'cos my clients are getting
miffed
> by my lack of software for them! :p
get libnet from CPAN
http://www.cpan.org/authors/id/G/GB/GBARR/libnet-1.0703.tar.gz
extract the file and copy it in the same directory as SMTP.pm
and Cmd.pm
This is "quick and dirty" (you should intall libnet correctly) but
it should work.
Good luck,
Peter Dintelmann
------------------------------
Date: Wed, 4 Apr 2001 10:15:29 -0400
From: "Skip Hollowell" <thollowe@opentext.com>
Subject: Perl File Converter using all available memory.
Message-Id: <9afa7q0671@enews4.newsguy.com>
I have script that is processing a 1 GB file, and reformatting it. The
problem is, it is using up every bit of memory on my system until it
eventually crashes out. What am I missing in this line by line processor
that is not releasing memory?
open (INPUT, 'Orca.new');
$page=1;
$count=0;
$null = "";
@fname=("ADDRESS","ADDRESS2","ADDRESS3","ALTADDRESS1","ALTADDRESS2","CITY","
STATE","ZIP","COUNTRY","COUNTY","ALTCITY","ALTSTATE","ALTZIP","PHONE","DOB",
"NAME","DATE_ISSUED","DATE_RENEWED","FILE_NUMBER","VIN","TAG","MAKE","MODEL"
,"YEAR","BODY","TITLE_DATE_ISSUED","TITLE_DATE_EXPIRES","LICENSE_TYPE","SELL
ER_NAME","PROP_ADDRESS","PROP_CITY","PROP_STATE","PROP_ZIP","PROP_COUNTY","S
ALE_DATE","SALE_AMOUNT","PROP_VALUE");
open (OUTPUT, '>Orca.txt');
while ($line=<INPUT>) {
# print $line;
chomp $line;
$count++; #$count has total number of pictures
@subfields=split('~', $line);
# print "\n";
$fnum=0;
print OUTPUT "R PERSON\n";
# print "R PERSON\n";
foreach $subfield (@subfields) {
if ($subfield) {
print OUTPUT "V " . $fname[$fnum] . "(1)=" . $subfield . "\n";
# print "V " . $fname[$fnum] . "(1)=" . $subfield . "\n";
}
$fnum++;
}
# print "====================EndOfRecord=============================\n";
}
close OUTPUT;
------------------------------
Date: 04 Apr 2001 18:39:37 +0100
From: nobull@mail.com
Subject: Re: Perl File Converter using all available memory.
Message-Id: <u9g0fosgx2.fsf@wcl-l.bham.ac.uk>
"Skip Hollowell" <thollowe@opentext.com> writes:
> I have script that is processing a 1 GB file, and reformatting it. The
> problem is, it is using up every bit of memory on my system until it
> eventually crashes out. What am I missing in this line by line processor
> that is not releasing memory?
I can see no obvious memory leaks in your code. Are you sure the file
contains more than one line? (I.E. are you sure you are using the
right end-of-line delimiter to read the file).
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 04 Apr 2001 11:55:36 -0400
From: Bernie Cosell <bernie@fantasyfarm.com>
Subject: Re: Perl Timer!
Message-Id: <7sgmctsl5a0l3m5tkr6aq98i8h9ja0fi9m@news.supernews.net>
"Philip Garrett" <philipg@atl.mediaonet.net> wrote:
} A quick example:
}
} sub say_hello {
} print "Hello, world!\n";
} }
}
} # tell the program to call say_hello() when it receives an alarm
} $SIG{ALRM} = \&say_hello;
}
} alarm(5); # set the alarm
} sleep; # wait for the alarm
Is this safe? I realize that doing a 'sleep' makes it OK, since Perl isn't
doing much of anything until the signal comes in, but as a rule: doesn't
Perl's problems with signals hitting at awkward times make it awfully
dangerous to do very much of anything _in_ the signal handler?
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
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 V10 Issue 627
**************************************