[19833] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2028 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 29 03:05:49 2001

Date: Mon, 29 Oct 2001 00:05:07 -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: <1004342707-v10-i2028@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 29 Oct 2001     Volume: 10 Number: 2028

Today's topics:
    Re: @_ array <wwonko@rdwarf.com>
    Re: Any good free syntax coloring editors for Perl on W <wwonko@rdwarf.com>
    Re: DBI/CSV Q <mikecook@cigarpool.com>
        double and single spacing  <hugo@fractalgraphics.com.au>
    Re: double and single spacing <jeff@vpservices.com>
    Re: double and single spacing (Jason Kohles)
    Re: double and single spacing <hugo@fractalgraphics.com.au>
    Re: Even without binmode,  txt file gets uploaded as BI nobull@mail.com
    Re: files in the process of being written to <justin.devanandan.allegakoen@intel.com>
        files in the process of being written <justin.devanandan.allegakoen@intel.com>
    Re: files in the process of being written <justin.devanandan.allegakoen@intel.com>
    Re: Newbie. nobull@mail.com
    Re: Perl in PWS <gmanon@netzero.net>
        regexp and printing \0,\1 etc... <perl.news@lfjr.net>
        Regexp for email address (Glenn White)
    Re: Regexp for email address <jurgenex@hotmail.com>
    Re: Regexp for email address (Glenn White)
    Re: Regexp for email address <Laocoon@eudoramail.com>
    Re: regular expression for url nobull@mail.com
    Re: What's wrong with File::Find <nospam-abuse@ilyaz.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 29 Oct 2001 00:22:54 +0000 (UTC)
From: Louis Erickson <wwonko@rdwarf.com>
Subject: Re: @_ array
Message-Id: <9ri7gu$70n$1@holly.rdwarf.com>

Tim Hammerquist <tim@vegeta.ath.cx> wrote:
: Me parece que Jens Luedicke <jens@irs-net.com> dijo:
:>  hi ...
:>  
:>  what would you recommend?
:>  
:>  my ($foo) = @_;
:>          or
:>  my $foo = (@_)[0];
:>          or
:>  my $foo = $_[0];

: my $foo = shift;

: If no argument is given, shift() defaults to @_.

: ...or you could go browse some code from modules on CPAN and see what
: their concensus is.  Why not make use of freely available code?

Both of these are good ideas.  The answer I use is, "It depends."

I'll use shift when there's one parameter.  If there's more than
one, I'll use an array assignment:

my ($foo, $bar, $baz) = @_;

If I only need one of the parameters, which is not the first, I'll
use the array index notation:

my $foo = $_[2];

That tends to be a rare item, though.  My functions usually wind up
with several parameters, so I usually wind up with the array
assignment.

Hope that helps.



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

Date: Mon, 29 Oct 2001 00:18:13 +0000 (UTC)
From: Louis Erickson <wwonko@rdwarf.com>
Subject: Re: Any good free syntax coloring editors for Perl on Windows?
Message-Id: <9ri785$6tc$1@holly.rdwarf.com>

Syamala Tadigadapa <syamalarao_tadigadapa@yahoo.com> wrote:

: Can some body send me pointers to some really good syntax coloring editors on
: Windows platform
: for Perl. There is good chance there are some. On Unix I suppose the
: possibility is quite remote.
: Maby be Vim works on both. But dows Vim allows you to compile the Perl
: script/module too?

: Please respond quickly .
: Free is better. Share ware is also Ok. But they all do expire in 30 days or
: even less. Don't they?

I'll be happy to reccomend Komodo from ActiveState.  It supports Perl
and Python and I think some others now, and seems pretty good.  It's
gotten a little tricky to find on their web site, but look here:

http://aspn.activestate.com/ASPN/Downloads/Komodo/More

This has a link on the side to the license agreement, and to the
different types; there's a trial, a commercial, and a non-profit or
personal or education license.  The personal/non-profit license is free
and the commercial isn't.  Read that carefully and decide if the
terms and costs are that which you can accept.

The regular expression toolkit it has in it is a very useful tool, and
I'll often fire it up just to untangle a broken regexp, and to see
what parts get put where.

Komodo works on Windows and Linux.




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

Date: Sun, 28 Oct 2001 17:20:34 -0700
From: "Michael Cook" <mikecook@cigarpool.com>
Subject: Re: DBI/CSV Q
Message-Id: <sh1D7.1567$Kb1.244309@news.uswest.net>

"Jeff Zucker" <jeff@vpservices.com> wrote in message
news:3BDAF598.45DA0A4D@vpservices.com...
> [Mike, don't mean to keep lecturing you on netiquette, but it usually
> ain't polite to send a personal email as a response to a newsgroup
> posting, and also there are other folks out there who could benefit from
> the answers to your questions so post your replies here unless it's
> actually a personal message]
>
> > Michael Cook wrote in email:
> > >
>
> > Thanks for the reply! I should have clarified a bit more. I went
> > so far as to replace the variable with a hard coded number & it fails.
>
> Yeah, I noticed, but the other stuff was pretty glaring.
>
> > I will clean up the other stuff you pointed out, thanks!
> >  Here's the down & dirty:
> >
> > $dbpath = './db';
> > $db = 'pipes';
> > $dbh =
> > DBI->connect("DBI:CSV:f_dir=$dbpath;csv_sep_char=:",,,{RaiseError=>1});
> > $dbh->do( qq{
> >             DELETE FROM $db
> >              WHERE productnumber = '1004'
> >            } );
> >
> > You see the 1004 is coded in, not dependent on the varaiable
> > interpretation & it still fails to delete that row.
>
> Ok, three comments: first, this is what you should have posted the first
> time, a nice trimmed down example of the problem without all the other
> stuff, second the RaiseError in your connection string is your main way
> of finding problems (use DBI-trace only when you have eliminated
> everything else), and third -- as I mentioned last time, this code is
> fine, there are no problems with it.
>
> So if your code is ok and DBI and DBD::CSV are ok (which we're pretty
> darn sure they are), then what remains to be not ok is your data.  I
> tried looking at your cat output of "pipes" but the line breaks made it
> impossible to read so I can only guess at what the problem is -- could
> be a matter of line endings, or a missing field separator somewhere.
> Does "SELECT * FROM $db WHERE productnumber = '1004'" work?  If not, I'd
> suggest starting with a simpler file and do some testing and hard look
> at your data file. If the select (on that same exact field) works but
> the delete doesn't, then we need to turn to OS and version issues so if
> that is the case, tell us your platform and versions of the various
> involved software.
>
> Good luck!
>
> --
> Jeff
>

Dude - you are da man!!! It was in the data - the ^M is required at the end
of each line. I added some lines manually & dos2unix'ed the file. I started
over & used my db loading script & voila!
    Thanks a mil!!!
        Michael
--
== CigarPool ==
http://www.cigarpool.com




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

Date: Mon, 29 Oct 2001 13:00:04 +0800
From: hugo <hugo@fractalgraphics.com.au>
Subject: double and single spacing 
Message-Id: <3BDCE254.4AE9D140@fractalgraphics.com.au>

Hi 

I have a problem I can't seem to solve although initially it seem
straightforward. 

I would like to grab an input file, then double space each line and
write the contents back out to an output file. I know this sounds
simple, but I seem only able to read in an input file with a buffer,
which means I cannot go through the input file line by line to add an
extra newline to the the lines of the output file. 

I thought it would be easy enough to do this: 

open(INFILE, "$datafile");
       open(OUTFILE, ">$fileconvert");
       while (INFILE) {
        print OUTFILE "$_\n";  #here I add the extra newline
       }
       close (INFILE);
       close(OUTFILE);

But nothing is written to the outfile, even if I change open(INFILE,
"$datafile"); to open(INFILE, "<$datafile");

I can only write the contents of the infile to the outfile if I use
"read" with a buffer: 

open( INFILE, "<$datafile" );
    open( OUTFILE, ">$fileconvert" );
    while ( read( INFILE, $buffer, 1024 ) ) {
      	 print OUTFILE "$buffer\n";
    }
    close( INFILE );    
    close( OUTFILE );

But here, as I am reading in a buffer at the time, I get only a newline
between buffers, and not at every line. This is a simple problem, but I
don't seem to get out of it. 

After I have done this, I would then like to give the user the option to
bundle some lines together once more with single spacing, For example,
if you have the lines: 

some text here

Subsequently  here is some text

which is now double spaced

and should be single spaced. 

and some more text here

I would like to give the reader the option to put in a keyword, which in
this case would be 
"Subsequently" and a number of lines, say 3. This then would bundle
these 3 lines single spaced so that we end up with: 

some text here

Subsequently  here is some text
which is now double spaced
and should be single spaced. 

and some more text here


I am not sure how to do this though. 

Can anyone help me with these two problems? 

Any help, particularly a code example, will be greatly appreciated.

Thanks. 

Hugo 


-- 
Dr Hugo Bouckaert
R&D Support Engineer, Fractal Graphics 
57 Havelock Street, West Perth 6005
Western Australia 6009
Tel: +618 9211 6000 Fax: +618 9226 1299
Email:hugo@fractalgraphics.com.au
Web: http://www.fractalgraphics.com.au


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

Date: Sun, 28 Oct 2001 21:01:05 -0800
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: double and single spacing
Message-Id: <3BDCE291.E7EB10D4@vpservices.com>

hugo wrote:
> 
> open(INFILE, "$datafile");

Should be:

    open(INFILE, $datafile) or die "Couldn't open '$datafile': $!";

> open(OUTFILE, ">$fileconvert");

Similar error checking there too.
  
> while (INFILE) {

Should have angle brackets:

    while( <INFILE> ) {

-- 
Jeff



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

Date: 29 Oct 2001 05:06:08 GMT
From: usenet@jasonkohles.com (Jason Kohles)
Subject: Re: double and single spacing
Message-Id: <slrn9tpopq.rmv.usenet@poseidon.mediabang.com>

On Mon, 29 Oct 2001 13:00:04 +0800, hugo wrote:
>I have a problem I can't seem to solve although initially it seem
>straightforward. 
>
>I thought it would be easy enough to do this: 
>
>open(INFILE, "$datafile");
>       open(OUTFILE, ">$fileconvert");
>       while (INFILE) {
>        print OUTFILE "$_\n";  #here I add the extra newline
>       }
>       close (INFILE);
>       close(OUTFILE);
>
>But nothing is written to the outfile, even if I change open(INFILE,
>"$datafile"); to open(INFILE, "<$datafile");
>
Your problem has nothing to do with the open, it has to do with the fact
that while(INFILE) doesn't mean anything, you seem to have meant
while(<INFILE>).

-- 
Jason S Kohles                               A witty saying proves nothing.
email@jasonkohles.com                           -- Voltaire (1694 - 1778)
http://www.jasonkohles.com/


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

Date: Mon, 29 Oct 2001 13:23:41 +0800
From: hugo <hugo@fractalgraphics.com.au>
Subject: Re: double and single spacing
Message-Id: <3BDCE7DD.21F8052B@fractalgraphics.com.au>

OOPs.. sorry about that first mistake - rather stupid really. 

Any ideas on the way to keep lines together? - I mean if I do the first
operation (double spacing) I suppose I would have to re-open the output
file once more to do the second operation, isn't it?  Or can they both
operations be done together somehow? 

Thanks

Hugo 

Jason Kohles wrote:
> 
> On Mon, 29 Oct 2001 13:00:04 +0800, hugo wrote:
> >I have a problem I can't seem to solve although initially it seem
> >straightforward.
> >
> >I thought it would be easy enough to do this:
> >
> >open(INFILE, "$datafile");
> >       open(OUTFILE, ">$fileconvert");
> >       while (INFILE) {
> >        print OUTFILE "$_\n";  #here I add the extra newline
> >       }
> >       close (INFILE);
> >       close(OUTFILE);
> >
> >But nothing is written to the outfile, even if I change open(INFILE,
> >"$datafile"); to open(INFILE, "<$datafile");
> >
> Your problem has nothing to do with the open, it has to do with the fact
> that while(INFILE) doesn't mean anything, you seem to have meant
> while(<INFILE>).
> 
> --
> Jason S Kohles                               A witty saying proves nothing.
> email@jasonkohles.com                           -- Voltaire (1694 - 1778)
> http://www.jasonkohles.com/

-- 
Dr Hugo Bouckaert
R&D Support Engineer, Fractal Graphics 
57 Havelock Street, West Perth 6005
Western Australia 6009
Tel: +618 9211 6000 Fax: +618 9226 1299
Email:hugo@fractalgraphics.com.au
Web: http://www.fractalgraphics.com.au


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

Date: 27 Oct 2001 22:30:14 +0100
From: nobull@mail.com
Subject: Re: Even without binmode,  txt file gets uploaded as BINARY instead of ASCII
Message-Id: <u9k7xg7oux.fsf@wcl-l.bham.ac.uk>

colorful_98@yahoo.com (Etal) writes:

> I sent the day trying to get this to work. Read the manuals and the
> news group. It should work but it does not.
> 
> I want to upload via browser a file from local drive to web. I NEED it
> in ASCII. According to perl manual, "Regardless of platform, use
> binmode() on binary files, and do not use binmode() on text files."
> 
> I tried with and without and my text file still uploads as binary. I
> found this script on the newsgroup, it's very nice, but I can't get it
> to upload in ASCII.
> 
> Does anyone have an idea?

Lack of binmode() causes \cJ in Perl output streams to be translated
to \cM\cJ when the Perl in question is running on a DOS-like
platform.  And that's about it.  It deos not magically alter the
behaiour of a web broswer running on a different machine before the
Perl script was even run.

In principle CGI.pm could convert all text values read from whateve
delimiter convention was sent by the browser into whatever uis used by
the server - but it doesn't.

You'll have to tr/\cM//d yourself.

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


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

Date: Mon, 29 Oct 2001 13:32:54 +0800
From: "Just in" <justin.devanandan.allegakoen@intel.com>
Subject: Re: files in the process of being written to
Message-Id: <9ripma$ce9@news.or.intel.com>

All,

Theres a problem I have come across, and to date
I haven't found a solution for.

The problem itself is not related to Perl, and I wouldn't
be surprised if I get a few catty replies, but its worth a
post because you guys are omniscient, and I am but a
mere mortal . . .

Here's the beef:-

I have a Perl program working as a scheduled task on
a Windoze 2000 server.

This utilises the Net::FTP module to connect to a
Unix workstation to do some FTP'ng.

The files on the Unix platform are created and written
to at any random moment in time. As far as I can figure out
the program running as a scheduled task has a nasty
habit of FTP'ng files from the Unix workstation over to
the 2000 server that haven't been finished being written to
(on the Unix workstation).

What I need to do is only FTP if the file has been completed being
written to.

Sorry, but for numerous reasons, the structure/methodology needs to
remain as is - scheduled task on Windoze, FTP from Unix etc etc.

I apologise for the double post . . .






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

Date: Sat, 27 Oct 2001 21:26:06 +0800
From: "Just in" <justin.devanandan.allegakoen@intel.com>
Subject: files in the process of being written
Message-Id: <9riiqi$8cl@news.or.intel.com>

All,

Theres a problem I have come across, and to date
I haven't found a solution for.

The problem itself is not related to Perl, and I wouldn't
be surprised if I get a few catty replies, but its worth a
post because you guys are omniscient, and I am but a
mere mortal . . .

Here's the beef:-

I have a Perl program working as a scheduled task on
a Windoze 2000 server.

This utilises the Net::FTP module to connect to a
Unix workstation to do some FTP'ng.

The files on the Unix platform are created and written
to at any random moment in time. As far as I can figure out
the program running as a scheduled task has a nasty
habit of FTP'ng files from the Unix workstation over to
the 2000 server that haven't been finished being written to
(on the Unix workstation).

What I'm looking for is a way to tell




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

Date: Mon, 29 Oct 2001 11:49:03 +0800
From: "Just in" <justin.devanandan.allegakoen@intel.com>
Subject: Re: files in the process of being written
Message-Id: <9rijji$8pb@news.or.intel.com>

this didnt get finished, let me continue . . . (see below)

"Just in" <justin.devanandan.allegakoen@intel.com> wrote in message
news:9riiqi$8cl@news.or.intel.com...
> All,
>
> Theres a problem I have come across, and to date
> I haven't found a solution for.
>
> The problem itself is not related to Perl, and I wouldn't
> be surprised if I get a few catty replies, but its worth a
> post because you guys are omniscient, and I am but a
> mere mortal . . .
>
> Here's the beef:-
>
> I have a Perl program working as a scheduled task on
> a Windoze 2000 server.
>
> This utilises the Net::FTP module to connect to a
> Unix workstation to do some FTP'ng.
>
> The files on the Unix platform are created and written
> to at any random moment in time. As far as I can figure out
> the program running as a scheduled task has a nasty
> habit of FTP'ng files from the Unix workstation over to
> the 2000 server that haven't been finished being written to
> (on the Unix workstation).
>

 What I need to do is only FTP if the file has been completed being
written to.

Sorry, but for numerous reasons, the structure/methodology needs to
remain as is - scheduled task on Windoze, FTP from Unix etc etc.

I apologise for the double post - I'm not sure what happened when I clicked
'Send Later', and synchronised therafter . . .




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

Date: 27 Oct 2001 22:47:34 +0100
From: nobull@mail.com
Subject: Re: Newbie.
Message-Id: <u9elno7o21.fsf@wcl-l.bham.ac.uk>

"Exodus" <exodus@thisaintreal.com> writes:

> Is it OK to post newbie questions to this group?

You appear to be asking about the posting guidelines for this group.
The posting guidelines were recently posted.

> Even if they are really obivious to some of you more experience programmers?

Yes but that fine.  But we do get upset if it would be obvious to a
complete novice who could be bothered to RTFM.  (You know the sort...
"I'm using the wibble() funtion and it doesn't snoznicate, why?" when
a the first paragraph of the documentation on the wibble() function
starts "This function does not snoznicate...").

I don't know if you are two lazy to read manuals - quite possibly you
are not, but you risk giving the wrong impression by using the word
"newbie" in he subject line - most people who use the word in their
subject lines use to mean "I've not RTFM".

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


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

Date: Mon, 29 Oct 2001 02:31:12 GMT
From: "gmanon" <gmanon@netzero.net>
Subject: Re: Perl in PWS
Message-Id: <Qb3D7.13297$XA5.4200682@typhoon.nyc.rr.com>

Thank you J.

I also discovered that the main problem of my script was that I was calling
a library that wasn't included in my main library.
I went to the web and download the library and my script is finally up and
running.

Thanks again,

gmanon

Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
news:9rgmtl$ovm$3@uranium.btinternet.com...
> gmanon <gmanon@netzero.net> wrote:
> > I am trying to run Perl CGI on a MS-PWS in Windows98 and I keep getting
this
> > error
> >
> >
> > The specified CGI application misbehaved by not returning a complete set
of
> > HTTP headers. The headers it did return are:
> >
> > Can't locate cgi-lib.pl in @INC (@INC contains: D:/Perl/lib
D:/Perl/site/lib
> > .) at C:\Inetpub\wwwroot\cgi-bin\greet.pl line 5.
> >
> > I wonder if I have to write the first code line like this:
> >
> > #!D:/Perl/lib/Perl.exe;
> >
> > Does anyone here knows how to solve this?
> >
>
> You will need to add the location of cgi-lib.pl to @INC using 'use lib'
> something like:
>
>   use lib 'd:/path/to/lib';
>
>
> However I would really suggest that you use the module CGI that comes
> standard with modern Perl - this module has a cgi-lib.pl emulation layer
> so you shouldnt have to change your programs all at once.
>
> /J\
> --
> Jonathan Stowe                      |
> <http://www.gellyfish.com>          |      This space for rent
>                                     |




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

Date: Mon, 29 Oct 2001 07:29:13 GMT
From: "M G" <perl.news@lfjr.net>
Subject: regexp and printing \0,\1 etc...
Message-Id: <dz7D7.20348$CN5.1408786@typhoon.mn.mediaone.net>

Let's imagine the following script:

---
#!/usr/bin/perl

$toto="totototo\0ut";

printf("%s\n",$toto);
---

How to get the printf to output

totototo\0ut

and not

totototo^@ut

I tried to escape it with regexp (s/\\/\\\\/) but visibly didn't help

thanks










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

Date: Mon, 29 Oct 2001 03:18:01 GMT
From: spam.killer@home.com_nospam (Glenn White)
Subject: Regexp for email address
Message-Id: <Xns9148C455FE541ccruizermydejacom@24.0.0.25>

I am writing a NT Perl program to take a text file, then mail the contents 
out using the TO and CC info from the file. The problem I'm running into 
has to do with how the address can be listed. Since it is on a intranet, 
the address can be either just the person's identifier or the whole 
address. EX: WRFL or WRFL@TESTER.COM. I'm trying to use Sendmail by Milivoj 
Ivkovic and have ran into a problem. It gives an error if I only use the 
identifier. 

I've solved the problem for the FROM field with the following:

# Get <from id> information
if ($line =~ /FROM/) {              
   @fields = split(/\=/, $line);
   $from_ID = "$fields[1]";
   if (not($from_ID =~ /[\w]@[\w\.\w]/)) {
     $from_ID =~ s/\n/\@tester\.com/;
}

The TO field is where I'm having trouble. There can be one to many 
addresses, and those address could be a mixture of identifiers and complete 
addresses. I've tried to write a regexp for the following statements: 1. 
There must be at least one address. 2. each address must have an 
identifier. 3. each address may or may not be the full address. 4. each 
address is seperated with a ";". 5. The end of the string does not have a 
";". 6. The identifier can include letters, numbers, minus signs, and dots 
(I forgot to include underscores). I then wrote an if statement to test for 
a failure of /((([(\w|\-|\.)]+@[\w\.\w])(\n|;))g/. Well... of course this 
doesn't work.

Question? Am I way off on my attempt? Even if I do find a failure, then I 
would need to change it into the full address. Would it be better to just 
go ahead and do the following I have listed below? I figure there should be 
at the most only four address to deal with.

# Get <to ids> information
if ($line =~ /TO/) {                
   @fields = split(/\=/, $line);
   $to_IDs = $fields[1];
   @fields = split(/\;/, $to_IDs);

$test0=$fields[0];
if (not($test0 =~ /[\w]@[\w\.\w]/)) {
   $test0 =~ s/\n/\@tester\.com;/;
}
# do a join here after testing [0 to ?]
   $mail{To}   = "$to_IDs";
}


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

Date: Sun, 28 Oct 2001 19:56:06 -0800
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Regexp for email address
Message-Id: <3bdcd35d@news.microsoft.com>


"Glenn White" <spam.killer@home.com_nospam> wrote in message
news:Xns9148C455FE541ccruizermydejacom@24.0.0.25...
> I am writing a NT Perl program to take a text file, then mail the contents
> out using the TO and CC info from the file. The problem I'm running into
> has to do with how the address can be listed. Since it is on a intranet,
> the address can be either just the person's identifier or the whole
> address. EX: WRFL or WRFL@TESTER.COM. I'm trying to use Sendmail by
Milivoj
> Ivkovic and have ran into a problem. It gives an error if I only use the
> identifier.
>
> I've solved the problem for the FROM field with the following:
[...]
> Question? Am I way off on my attempt? Even if I do find a failure, then I

Are you dealing with internal addresses *only* or may those be regular
Internet Email-Addresses, too? If you need regular addresses, too, then I
suggest to read
    Found in C:\Perl\lib\pod\perlfaq9.pod
      How do I check a valid mail address?

It's quite enlightening

jue




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

Date: Mon, 29 Oct 2001 05:42:47 GMT
From: spam.killer@home.com_nospam (Glenn White)
Subject: Re: Regexp for email address
Message-Id: <Xns9148DCE11E2EEccruizermydejacom@24.0.0.25>

"Jürgen Exner" <jurgenex@hotmail.com> wrote in
<3bdcd35d@news.microsoft.com>: 

>Are you dealing with internal addresses *only* or may those be regular
>Internet Email-Addresses, too? If you need regular addresses, too, then
>I suggest to read
>    Found in C:\Perl\lib\pod\perlfaq9.pod
>      How do I check a valid mail address?
>
>It's quite enlightening
>
>jue

For the most part, they will be internal addresses. Unfortunately, I can 
already forsee that Internet Email-Addresses will creap in.

I just read perlfaq9.pod and I'm not seeing how it contributes to my 
delema. I am not all that proficeint in using regexp, but the /^[\w.-
]+\@(?:[\w-]+\.)+\w+$/ example looks like it will miss ones such as 
first.last@tester.com. The link to 
http://www.perl.com/CPAN/authors/Tom_Christiansen/scripts/ckaddr.gz was off 
in an entirely different direction.

All I'm trying to do is to take something like the following:
TO=FIRST-LAST;CRCG@TESTER.COM;RWBR

and turn it into:
FIRST-LAST@TESTER.COM;CRCG@TESTER.COM;RWBR@TESTER.COM

From a C++ point of view it wouldn't be all that difficult... long winded, 
but not that difficult. I was hoping to do it a bit more Perlish.


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

Date: Mon, 29 Oct 2001 08:59:45 +0100
From: Laocoon <Laocoon@eudoramail.com>
Subject: Re: Regexp for email address
Message-Id: <Xns91495B83CAB4DLaocooneudoramailcom@62.153.159.134>

*snip*
> All I'm trying to do is to take something like the following:
> TO=FIRST-LAST;CRCG@TESTER.COM;RWBR
> 
> and turn it into:
> FIRST-LAST@TESTER.COM;CRCG@TESTER.COM;RWBR@TESTER.COM
*snip*

$emails =~ s/TO=(.+)(\@\w+\.\w+)/$1/ and $a = $2;
$emails =~ s/$_/$_$a/ for split ';',$emails;

Not very elegant i know.. I will get back to it later

Lao


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

Date: 27 Oct 2001 22:34:23 +0100
From: nobull@mail.com
Subject: Re: regular expression for url
Message-Id: <u9hesk7oo0.fsf@wcl-l.bham.ac.uk>

"Aditya" <isaditya@yahoo.com> writes:

> Thanks for your reply. Now i have another question. I read the manpage
> for the module and came across URL_GUESS_PATTERN. I could not find how to
> actually use it. The way it is given in the manpage doesn't help me. Any
> suggestions?

Perl modules are shipped as source.  If you find an error or omission
in the POD then examine the Perl source and submit a patch to correct
the omission.

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


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

Date: Sun, 28 Oct 2001 23:37:13 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: What's wrong with File::Find
Message-Id: <9ri4r9$mn$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Dan Sugalski 
<dan@tuatha.sidhe.org>], who wrote in article <a1YC7.133631$NT3.14336070@news1.rdc1.ct.home.com>:
> > Hmm?  Unless on some advanced OS (e.g., OS/2 allows thread-local
> > storage, with which different thread read different data from the same
> > virtual address), you can *always* pass a pointer to something
> > thread-specific to another thread.  So what you say has no meaning,
> > thus irrelevant.
> 
> Nonsense. Thread-specific has a definite meaning for most people--"only
> available to a particular thread".

Unless on some advanced OS (e.g., OS/2 allows thread-local storage,
with which different thread read different data from the same virtual
address), you can *always* pass a pointer to something thread-specific
to another thread.  Given that there is no "object" which satisfies
your definition, I doubt that "most people" agree with your definition.

Ilya


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

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


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