[22669] in Perl-Users-Digest
Perl-Users Digest, Issue: 4890 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 24 21:05:48 2003
Date: Thu, 24 Apr 2003 18:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 24 Apr 2003 Volume: 10 Number: 4890
Today's topics:
Re: ActivePerl alarm() on Windows <kalinabears@hdc.com.au>
ANNOUNCE: Spreadsheet::WriteExcel 0.41 (John McNamara)
Re: approximate substitution <goldbb2@earthlink.net>
Re: compare two files (Herb Burnswell)
Re: file upload not working anymore ctcgag@hotmail.com
Getting FULL path+filename from a filehandle <michael.p.broida@boeing.com>
Help with creating UDP sockets using IO::Socket <imarine@bigpond.net.au>
Inserting Perl Results into Webpage <chris_12003@yahoo.com>
Re: Inserting Perl Results into Webpage <mbudash@sonic.net>
Re: Net::FTP delete problem <kalinabears@hdc.com.au>
Re: Parent & Child question: (Cao Tran)
Perl on JVM -- any links? <nomail@hursley.ibm.com>
Problem updating data in DB2 from webserver? <shah@typhoon.xnet.com>
Re: regular expression question (siva chelliah)
Re: Removal of newline characters <michael.p.broida@boeing.com>
Re: Removal of newline characters (Stephen Adam)
Re: Replacing '@' in Strings <wksmith@optonline.net>
Re: Tough question for the guru's; Grep Once, Awk Twice (Agrapha)
Re: Tough question for the guru's; Grep Once, Awk Twice (Agrapha)
WEB server testing results here - http://www.softrex.co <hsoft@mail.ru>
Re: {newbie} sorting of files <uri@stemsystems.com>
Re: {newbie} sorting of files <wksmith@optonline.net>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 25 Apr 2003 09:21:47 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: ActivePerl alarm() on Windows
Message-Id: <3ea87286$0$16992@echo-01.iinet.net.au>
"Yehuda Berlinger" <jon@actcom.co.il> wrote in message
news:Xns93679CF3377D1jonactcomcoil@192.114.47.10...
> Yehuda Berlinger <jon@actcom.co.il> wrote in
> news:Xns936795CC4CFCEjonactcomcoil@192.114.47.10:
>
> > I am using ActivePerl alarm() on a Win 98 box. The docs seem to say
> > that neither alarm() or POSIX::alarm() work, but they do work, at
> > least, they do for me. What they don't do is return the time remining
> > on the previous alarm().
> >
alarm() is available with perl 5.8 but not with perl 5.6.
Unfortunately it seems that the particular functionality you seek is *not*
supported.
For me, AS build 802 on Win2k, $time_left is always zero, irrespective of
how much time should be left on the first timer.
Maybe something like (untested):
my $timeout = 100;
my $t0 = time;
alarm $timeout;
# run the code
alarm 0;
my $t1 = time;
my $time_left = $timeout + $t0 - $t1;
Cheers,
Rob
------------------------------
Date: Fri, 25 Apr 2003 00:43:25 GMT
From: jmcnamara@cpan.org (John McNamara)
Subject: ANNOUNCE: Spreadsheet::WriteExcel 0.41
Message-Id: <4af9c694f829ffdf0f8cecf6846caef3@TeraNews>
======================================================================
ANNOUNCE
Spreadsheet::WriteExcel version 0.41 has been uploaded to CPAN.
======================================================================
NAME
Spreadsheet::WriteExcel - Write formatted text and numbers to a
cross-platform Excel binary file.
======================================================================
CHANGES
Minor release
+ Added facility for adding outlines to worksheets. Added
outline.pl example. Thanks to Franco Venturi.
+ Moved write_comment() code into the core modules. It is now
possible to write cell comments.
+ Added option to return a slice from the sheets() method.
! Changed, once more, the handling of temp files to avoid several
file closing bugs. Thanks to many.
! Fixed handling of column sizing for widths less than 1 unit.
Thanks Rubio.
! Renamed addworksheet() and addformat() to add_worksheet()
and add_format() for consistency with other method names.
Older names are supported but deprecated.
An Excel97 pre-release version of the module that supports long
strings (32k) and Unicode is now available. See:
http://freshmeat.net/projects/writeexcel/#comment-24916
======================================================================
DESCRIPTION
The Spreadsheet::WriteExcel module can be used create a cross-
platform Excel binary file. Multiple worksheets can be added to a
workbook and formatting can be applied to cells. Text, numbers,
formulas and hyperlinks and images can be written to the cells.
The Excel file produced by this module is compatible with Excel 5,
95, 97, 2000 and 2002.
The module will work on the majority of Windows, UNIX and
Macintosh platforms. Generated files are also compatible with the
Linux/UNIX spreadsheet applications Gnumeric and OpenOffice.
The generated files are not compatible with MS Access.
This module cannot be used to read an Excel file. See
Spreadsheet::ParseExcel or look at the main documentation for some
suggestions.
This module cannot be used to write to an existing Excel file.
======================================================================
SYNOPSIS
To write a string, a formatted string, a number and a formula to
the first worksheet in an Excel workbook called perl.xls:
use Spreadsheet::WriteExcel;
# Create a new Excel workbook
my $workbook = Spreadsheet::WriteExcel->new("perl.xls");
# Add a worksheet
$worksheet = $workbook->addworksheet();
# Add and define a format
$format = $workbook->addformat(); # Add a format
$format->set_bold();
$format->set_color('red');
$format->set_align('center');
# Write a formatted and unformatted string
$col = $row = 0;
$worksheet->write($row, $col, "Hi Excel!", $format);
$worksheet->write(1, $col, "Hi Excel!");
# Write a number and a formula using A1 notation
$worksheet->write('A3', 1.2345);
$worksheet->write('A4', '=SIN(PI()/4)');
======================================================================
REQUIREMENTS
This module requires Perl 5.005 (or later), Parse::RecDescent and
File::Temp
http://search.cpan.org/search?dist=Parse-RecDescent
http://search.cpan.org/search?dist=File-Temp
======================================================================
AUTHOR
John McNamara (jmcnamara@cpan.org)
--
------------------------------
Date: Wed, 23 Apr 2003 22:38:48 -0400
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: approximate substitution
Message-Id: <3EA74E38.6C48E227@earthlink.net>
Malte Ubl wrote:
>
> Hi,
>
> I was playing around a little with different approximate substitution
> methods. What I want to achieve in the end is to search user input for
> strings that look like entries in a database and wrap those string with
> HTML links containing the corresponding record id.
>
> An example would be this:
>
> %word2id = ( "some String" => 200 );
>
> input: just some text including same Sting bla bla
> output: just talking some <a href="200.html">same Sting</a> bla bla
[snip]
> Maybe I should split my input into strings of words that can be
> candidates for a fuzzy match (e.g. for a 2 word pattern, match the
> pattern against any 2 words in the input string). That would also
> eliminate the problem, that the fuzzy match (especially if the matching
> word is actually an exact match) sometimes includes characters from
> other words surrounding the matching string.
>
> Hmm, I just wanted to ask, whether anybody knows of a better algorithm
> to do this kind of stuff or even better a module that does what I want.
Have you considered trying Text::Soundex?
use Text::Soundex;
use constant CODELEN => 4; # all soundex codes are 4 chars long.
# the default of $soundex_nocode is undef ... since we want
# all strings to map to fixed length soundex codes, so we can
# calculate array indices from string indices, that's not good.
$soundex_nocode = "!" x CODELEN;
# initial string
my $input = "just some text including same Sting bla bla";
# deal with it as an array of words
my @input = split ' ', $input;
# what's the fuzzy version of the input string?
my $fuzzy = join("", soundex @input );
# for each thing being searched for...
while( my ($search_for, $subs_with) = each %word2id ) {
# what's the fuzzy version of what we're searching for?
my $fuzzysearch = join("", soundex( split ' ', $search_for ) );
# num letters of $fuzzy
my $substrlen = length($fuzzysearch);
# num elements of @input.
my $splicelen = length($fuzzysearch) / CODELEN;
# Find all the matches of $fuzzysearch in $fuzzy.
my @matches;
push @matches, $-[0] / CODELEN
while $fuzzy =~ /$fuzzysearch/g;
# since we're doing things which change indices,
# processing the last match first decreases complexity.
foreach( reverse @matches ) {
# the original, non-fuzzy text,
# corresponding to this match.
my $matched = join(" ", @input[ $_ .. $_ + $splicelen - 1 ] );
# The replacement text.
my $replace = qq{<a href="$subs_with">$matched</a>};
# Replace all original elements corresponding to
# the match with the one single replacement value.
splice( @input, $match, $splicelen, $replace );
# Make sure that no more replacements happen here.
substr( $fuzzy, $_ * CODELEN, $substrlen ) = "." x CODELEN;
}
}
print join(" ", @input), "\n";
__END__
[untested]
--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}
------------------------------
Date: 24 Apr 2003 15:11:53 -0700
From: patyoung13@hotmail.com (Herb Burnswell)
Subject: Re: compare two files
Message-Id: <3b38898e.0304241411.32930c96@posting.google.com>
helgi@decode.is (Helgi Briem) wrote in message news:<3ea56eca.1042801248@news.cis.dfn.de>...
> On Tue, 22 Apr 2003 16:06:13 GMT, Andras Malatinszky
> <nobody@dev.null> wrote:
>
> >Helgi Briem wrote:
>
> >> Isn't that an unnecesssarily complex way to do it?
> >>
> >> my $sizediff = abs((-s $file1) - (-s $file2));
> >> if ($sizediff > 300) { # do something }
> >>
> > From a didactical point of view (i.e., for a self-described beginner
> >who may not understand why you are using that "minus s") Barry's
> >approach may be preferrable.
>
> But isn't the -s operator, or in fact the whole class
> of minus X operators, one of the first things a beginner
> should learn?
>
> After all, a lot of the tasks one might tackle using
> Perl involve the age of files, the size of files, the
> type of file, the existence of file, the owner of
> files and so on and so forth, which is what you
> use the -X operators for.
>
> perldoc -f -X for details.
Hi,
I would like to thank all that responded. I have found that it works
best for me to use:
$file1 = "logfile1";
$file2 = "logfile2";
$size1 = `wc -l $file1 | awk '{print \$1}'`;
$size2 = `wc -l $file2 | awk '{print \$1}'`;
$diff = ($size1 - $size2);
if ( abs($diff)>n ) { # mail me
I have however done much reading on minux X operators. It will come
in handy. Thanks again for all suggestions.
Herb
------------------------------
Date: 25 Apr 2003 00:23:48 GMT
From: ctcgag@hotmail.com
Subject: Re: file upload not working anymore
Message-Id: <20030424202348.750$Sf@newsreader.com>
Andy Meier <andy@mindpilot.ch> wrote:
> Hi,
>
> Since over a year I'm using a perl program (using CGI.pm) to upload files
> on a server via a browser. And it work perfectly since yesterday. When I
> try to upload file now, the files created on server always results with a
> size of 0KB !?
>
> I did not modify the perl program at all. The Plesk hosting panel says
> that there is still plenty of disc space available. I'm also using the
> same program on different servers where it still works.
>
> Can anyone point me in the right direction with this?
Did your hosting service recently upgrade CGI.pm (or perl in general)?
I've spent a couple of days chasing a problem caused by IT silently
"upgrading" CGI to some bizarre version that wasn't on CPAN. I never
did figure out where they got it from. It selectively broke multi-part
forms.
Xho
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service New Rate! $9.95/Month 50GB
------------------------------
Date: Thu, 24 Apr 2003 22:42:21 GMT
From: "Michael P. Broida" <michael.p.broida@boeing.com>
Subject: Getting FULL path+filename from a filehandle
Message-Id: <3EA8684D.5A00ED68@boeing.com>
Hi!
I've been digging through the Camel book and haven't been
able to find out how to get the FULL path+filename from a
filehandle.
At the time the file was opened, I had "current directory"
and the "filename" (with possible partial/relative path).
So the "open" worked just fine. And I could, at that point,
build the full path from that info.
But later, possibly several functions and or packages later,
I need to get the actual path+filename out of the filehandle
that has been passed around. Current directory could have
been changed by this point. And I really don't want to
re-engineer the sub calling structure to pass another variable
all the way down there. <grin>
I know the OS has that info, but I can't seem to find any
way to get it in Perl. Any ideas/pointers??
I've exhausted all the keywords I can think of for both
"perldoc -q" and "perldoc", and I've learned a ton of
stuff about filenames/handles/opening/etc, but haven't
found this particular bit of info.
Mike
------------------------------
Date: Thu, 24 Apr 2003 23:56:47 GMT
From: Justin <imarine@bigpond.net.au>
Subject: Help with creating UDP sockets using IO::Socket
Message-Id: <1dugav0sa62dvph8s6mtvqpn99r42c7hqm@4ax.com>
Here is what I have:
my $wb_server = IO::Socket::INET->new(LocalPort => $wb_server_port,
Proto => "tcp",
Type => SOCK_STREAM,
Listen => 250 );
my $lc_server = IO::Socket::INET->new(LocalPort => $lc_server_port,
Proto => "udp",
Type => SOCK_DGRAM,
Listen => 10);
The first socket connection using TCP works, but the second for UDP does not.
Any ideas???
Cheers
Justin
------------------------------
Date: Fri, 25 Apr 2003 00:07:15 GMT
From: "Chris" <chris_12003@yahoo.com>
Subject: Inserting Perl Results into Webpage
Message-Id: <N__pa.609789$L1.172633@sccrnsc02>
I have a perl script that displays data on the screen. I'd like the data to
be inserted into a table cell on my html webpage. I imagine I need to
create another perl script with my html coding but I'm not sure how to call
the original script to have it display its results in the table. Can
someone point me in the right direction of how to do this?
Thanks for the help,
Chris
------------------------------
Date: Fri, 25 Apr 2003 00:35:31 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Inserting Perl Results into Webpage
Message-Id: <mbudash-CB7616.17353124042003@typhoon.sonic.net>
In article <N__pa.609789$L1.172633@sccrnsc02>,
"Chris" <chris_12003@yahoo.com> wrote:
> I have a perl script that displays data on the screen. I'd like the data to
> be inserted into a table cell on my html webpage. I imagine I need to
> create another perl script with my html coding but I'm not sure how to call
> the original script to have it display its results in the table. Can
> someone point me in the right direction of how to do this?
>
> Thanks for the help,
> Chris
>
>
one way would be a server-side include (assuming your host supports
them), e.g.:
<table>
<tr>
<td><!--#include virtual="/path/to/script.cgi" --></td>
</tr>
</table>
another way would be to turn it inside out, i.e., have the script
generate the whole page, either from a template that it "fills in", or
entirely within the script.
hth-
--
Michael Budash
------------------------------
Date: Fri, 25 Apr 2003 10:08:30 +1000
From: "Sisyphus" <kalinabears@hdc.com.au>
Subject: Re: Net::FTP delete problem
Message-Id: <3ea87d79$0$17000@echo-01.iinet.net.au>
"Arde" <huuhaa@kastema.to> wrote in message
news:3ea82e48$1@news.dnainternet.net...
> Hi!
> I've got a weird problem when I'm trying to delete a file with
> $ftp->delete($_); in my script.
> Deleting a file takes forever and it seems to fail (if I use
> '$ftp->delete($_) or die;' the script dies) but the file is deleted
anyway.
> Is there an alternative to 'delete'? I tried to use 'quote' with delete +
> file as command but that doesn't work. Please provide a real life example
> how to solve this problem. Thanks.
>
'$ftp->delete($_);' has always worked fine for me - and the docs indicate
that a successful 'delete' operation returns 'true' for success and 'false'
for failure - so the script should not die if the file is deleted.
My guess is that it's not a perl issue.
Maybe try a google search to see if this problem (and the solution) has
arisen before.
Or perhaps the tech staff at the hosting company might be able to provide a
suggestion as to why the 'delete' procedure is misbehaving.
Cheers,
Rob
------------------------------
Date: 24 Apr 2003 17:54:47 -0700
From: caotran@sbcglobal.net (Cao Tran)
Subject: Re: Parent & Child question:
Message-Id: <d2256902.0304241654.7336c910@posting.google.com>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<b8838p$2qr$1@mamenchi.zrz.TU-Berlin.DE>...
> Cao Tran <caotran@sbcglobal.net> wrote in comp.lang.perl.misc:
> > Hi,
> >
> > Here is what I want to do:#! /usr/local/bin/perl
> ^
> That blank shouldn't be there.
>
> Also, you are running without warnings or strict. When a program
> gives you trouble, switch them on and correct whatever they point
> out. You should do that *before* posting to clpm.
>
> > $None = $#ARGV + 1;
> >
> > if ($None == "0"){
>
> This is better written as
>
> unless ( @ARGV ) {
>
> > print "USAGE: schematic {PROGRAM_NAME}!\n";
> > exit;
> > }
> >
> > $ARGV[0] =~ tr/a-z/A-Z/;
>
> Better:
>
> $ARGV[ 0] = lc $ARGV[ 0];
>
> > $project = $ARGV[0];
>
> You never use the variable "$project".
>
> > $HOME=$ENV{HOME};
> >
> > Schematic();
> >
> > sub Schematic{
> >
> > $ENV{PATH}= "$HOME/tmp/schematics/";
>
> This is the problem you are asking about. After you set the shell
> path to ".../tmp/schematics", only commands (executables) in this
> directory will be executed by default. All others (including ls)
> would have to be fully qualified (/bin/ls).
>
> Scratch that line. It serves no purpose.
>
> > open(LS,"ls *.ps|");
> > while(<LS>) {
> > tr/A-Z/a-z/;
> > ($num) = /_[_]+(\w+)\.ps/ ;
> ^ ^
> What are the "[]" for?
>
> > $num = "$2" ."$1" if $num =~ /([a-z])(\d+)/ ;
> > rename($name, "$num.ps");
> > }
> > close (LS);
> > print $ENV{PATH};
> > }
> >
> > When I run this script, I got this message:
> > sh: ls: not found
> >
> > But when I change to sh, and type ls, it work?
>
> Change your path to what it is in the script and try again.
>
> Anno
Many thanks to all who contributed to this message. I so greatfull to
you guys for showing me how inefficient my code was. I just realize
that I have a lot more to learn to program effectively.
------------------------------
Date: Fri, 25 Apr 2003 00:28:26 +0100
From: saket <nomail@hursley.ibm.com>
Subject: Perl on JVM -- any links?
Message-Id: <b89rus$lm0$1@sp15at20.hursley.ibm.com>
Kindly let me know if such a thing exists?
or something like Netrexx-Java ?
Thanks
saket
------------------------------
Date: Thu, 24 Apr 2003 23:38:24 +0000 (UTC)
From: Hemant Shah <shah@typhoon.xnet.com>
Subject: Problem updating data in DB2 from webserver?
Message-Id: <b89shg$8jv$1@flood.xnet.com>
I have following setup:
DB2 UDB 7.2 running on AIX 4.3.3, DB2 UDB 7.2 client running on RH Linux
kernel 2.4.18-5. The Linux system is also running Apache webserver
with modperl.
I am using CGI.pm to render HTML pages and I also use DBI and DBD::DB2
to query the database. The script that queries the database is working O.K.
But the script I use to update the table is giving me problems.
When I try to insert or delete a row from the table, I get error message that
I am violating constraint 1. I checked all the constraints on the table
but I cannot see it violating any constraints. Funny thing is that the insert
or delete is done successfully. I have turned off AutoCommit so it should
not commit anything. Couple of other things I noticed is that when the update
of the table fails, I cannot use the database, I cannot even do the queries
on the command line unless I run "force application all".
I also noticed that even though I execute $dbh->disconnect, the connection is
still there, "list applications" show all the connection with UOW waiting.
I have written many perl script with DBD::DB2 and I have never encountered
such problem. This the first time I am writing perl script that is execute
from a web server using mod_perl.
Are there any tricks to writing DBD:DB2 scripts while running under mod_perl?
Thanks.
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
------------------------------
Date: 24 Apr 2003 15:56:48 -0700
From: podian@yahoo.com (siva chelliah)
Subject: Re: regular expression question
Message-Id: <5d146344.0304241456.7772fdf7@posting.google.com>
Actually I was using the terminology used by Randal in the book Learning Perl.
In that example, he gives the following:
The pattern /a(.*)b\1c/
matches aFREDbFREDc but not aXXbXXXc
now I understand why. In the example, there is a 'c' at the end (after b\1)
Thanks,
Siva
Brian McCauley <nobull@mail.com> wrote in message news:<u9of2x9mbm.fsf@wcl-l.bham.ac.uk>...
> podian@yahoo.com (siva chelliah) writes:
>
> > Hi,
> > The following regular expression:
> >
> > /FRED(.*)\s.*BARNEY\1/
> >
> > matches the following string and I thought it should not.
> >
> > FREDyyy something here BARNEYyyyy
>
> This is untrue.
>
> You are most likely allowing yourself to be confused by your own
> sloppy terminolgy.
>
> Sloppy short-hand terminolgy is fine as long as everyone knows it's
> sloppy and short-hand and doesn't try take it literally.
>
> The regex /i/ _finds_ a match in "wibble". It does not _match_
> "wibble". What it matches is just the "i". Often, however, people
> will say /i/ matches "wibble" but everyone should know not to take it
> literally.
>
> Likewise /FRED(.*)\s.*BARNEY\1/ finds a match in "FREDyyy something
> here BARNEYyyyy". It does not, as you claim, match "FREDyyy something
> here BARNEYyyyy" what it matched is just "FREDyyy something here
> BARNEYyyy".
>
> Perhaps you really meant /FRED(\S*)\s.*BARNEY\1(?!\S)/
------------------------------
Date: Thu, 24 Apr 2003 22:08:23 GMT
From: "Michael P. Broida" <michael.p.broida@boeing.com>
Subject: Re: Removal of newline characters
Message-Id: <3EA86057.CFF08B54@boeing.com>
"Eric J. Roode" wrote:
>
> "Michael P. Broida" <michael.p.broida@boeing.com> wrote in
> news:3EA72AA9.EF5CF8DB@boeing.com:
>
> > "chomp()" only removes ONE newline from the END
> > of the scalar IF there is one there.
>
> and IF $/ is "\n".
Good caveat. :)
------------------------------
Date: 24 Apr 2003 16:46:17 -0700
From: 00056312@brookes.ac.uk (Stephen Adam)
Subject: Re: Removal of newline characters
Message-Id: <945bf980.0304241546.18ba8147@posting.google.com>
Thanks for the help guys, much appreciated. My code works fine now, it
was just the "g" for global that was missing + cheers for the
suggestion on getting rid of that loop, has speeded my code up quite a
bit. Hope you all have had a good easter.
Take care
Steve
"A plan is just a list of things which don't happen"
------------------------------
Date: Thu, 24 Apr 2003 22:16:36 GMT
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: Replacing '@' in Strings
Message-Id: <8nZpa.119431$MB4.40279026@news4.srv.hcvlny.cv.net>
"Matt Krawczyk" <goaliefight@evil-snowman.com> wrote in message
news:3e96fdb0.0304241251.6778d725@posting.google.com...
> I've been trying for the past two hours or so to match and replace @
> characters in email addresses with \@. The idea is to take a text file
> full of email address (one on each line), and cycle through sending a
> message to everyone on the list. Problem is, I can't for the life of
> me figure out how to force the program to do that replace for me so
perl -ibak -pe's/@/\\@/' file.dat
will do what you ask, but probably will not solve your problem.
> that when I try to use sendmail, it doesn't fail. Even attempting to
> simply display the email address on-screen causes problems, and the
> address gets cut in half with only part of it being displayed.
>
> Example:
>
> print("someuser@my-company.com","\n");
>
> Is shown as...
>
> someuser-company.com
>
> ...on the screen.
>
> NOTE: "someuser\@my-company.com" works fine.
>
These examples are correct for litteral strings. The content of a
string variable is different. Are you sure that your data file is
correct? The email addresses should look normal (no escape characters)
when viewed with an editor. If not, seek help in writing the file, else
verify that the file is being read correctly. Print the raw data (or
examine it with debug) immediatly after reading it. Again, the email
addresses should appear normal. If not, post a sample of this data and
the code that reads it incorrectly.
> I've tried escaping the character, but it's not helping me at all, and
Where did you do this?
> I'm starting to lose my mind. I've searched through both Perl books I
> have here, as well as any online documentation that I can find, and
> still nothing works. Any advice that might work would be greatly
> appreciated.
Tassilo provided an explanation of the escape syntax. I have tried to
give you a procedure to narrow the scope of your problem.
Good Luck,
Bill
------------------------------
Date: 24 Apr 2003 16:05:59 -0700
From: brian@box201.com (Agrapha)
Subject: Re: Tough question for the guru's; Grep Once, Awk Twice (or more)
Message-Id: <11aabb15.0304241505.6636e807@posting.google.com>
"Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in message news:<b89ai6$ud$1@nets3.rz.RWTH-Aachen.DE>...
> 'perl -v'. As far as I know, FreeBSD 4.7 comes with 5.00303 (the version
> prior to 5.6.0). Not sure when the FAQ in question was introduced.
You are correct:
$ perl -v
This is perl, version 5.005_03 built for i386-freebsd
Copyright 1987-1999, Larry Wall
I guess I need to visit my local ports collection Thank you Tassilo.
------------------------------
Date: 24 Apr 2003 16:44:40 -0700
From: brian@box201.com (Agrapha)
Subject: Re: Tough question for the guru's; Grep Once, Awk Twice (or more)
Message-Id: <11aabb15.0304241544.1eff4b6a@posting.google.com>
"Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in message news:<b88igv$rc2$1@nets3.rz.RWTH-Aachen.DE>...
> Could we please put an end to all this noise? I think it has been
> pointed out to the OP clearly enough what he did wrong (and he seems to
> have understood). We should rather focus on the Perl-content of this
> thread (now that it finally has such a thing).
>
Agreed. A few less flame throwers will be much appreciated. I will do
my best not to antagonize the jackles predisposed to derision and
mayhem. I should have had higher standards.
------------------------------
Date: Thu, 24 Apr 2003 22:06:53 +0000 (UTC)
From: Ivan Draga <hsoft@mail.ru>
Subject: WEB server testing results here - http://www.softrex.com/tornado/eng_test.html
Message-Id: <b89n5q$itt$32@news.rol.ru>
25.04.2003 St.Petersburg
WEB server testing results here: http://www.softrex.com/tornado/eng_test.html
------------------------------
Date: Thu, 24 Apr 2003 22:47:12 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: {newbie} sorting of files
Message-Id: <x7of2vjyxb.fsf@mail.sysarch.com>
>>>>> "TM" == Tad McClellan <tadmc@augustmail.com> writes:
TM> programming Perl without "use strict"
TM> If you'd done the 2nd, then perl itself would have pointed
TM> out the problem in milliseconds.
actually i disagree there. he had this:
o> $file_hash{b} <=> $file_hash{a}
which doesn't break strict or warn AFAIK (not tested).
and that was his first top posting so let him off with a warning and
don't be so strict unless he does it again. :)
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 24 Apr 2003 23:03:48 GMT
From: "Bill Smith" <wksmith@optonline.net>
Subject: Re: {newbie} sorting of files
Message-Id: <o3_pa.120670$MB4.40452999@news4.srv.hcvlny.cv.net>
"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x765p3lh0y.fsf@mail.sysarch.com...
> >>>>> "o" == oracle1 <santyspamsharma@hotmail.com> writes:
>
> o> sub by_time_and_files {
> o> $file_hash{b} <=> $file_hash{a}
> $b $a
This is the kind of error that use strict usually finds. I understand
that this is a special casek and it would not have helped, but my advice
is still "always use strict".
Bill
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
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 4890
***************************************