[17420] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4840 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 8 00:05:43 2000

Date: Tue, 7 Nov 2000 21:05:13 -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: <973659912-v9-i4840@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 7 Nov 2000     Volume: 9 Number: 4840

Today's topics:
    Re: $password = crypt($pass, ar); (Gwyn Judd)
        [Way OT] Re: OOP and information hiding (Gwyn Judd)
        DBI and mysql <thalion@wonderd.com>
    Re: DBI and mysql (bowman)
    Re: Detecting socket closure (Charles DeRykus)
    Re: Detecting socket closure (Charles DeRykus)
    Re: HELP Winows NT Mail::Sender (Tim Hammerquist)
    Re: HELP Winows NT Mail::Sender <paul.g@cableinet.co.uk>
    Re: HELP Winows NT Mail::Sender <paul.g@cableinet.co.uk>
    Re: HELP Winows NT Mail::Sender <paul.g@cableinet.co.uk>
    Re: HELP Winows NT Mail::Sender <dave_at_hm@hotmail.com>
    Re: HELP Winows NT Mail::Sender <dave_at_hm@hotmail.com>
    Re: Help! Can't use "next LABEL" in SIG{ALRM} sub (Tad McClellan)
    Re: How to return @Array1 and @Array2? (Tad McClellan)
        Looking for a one-liner <megrimes@flash.net>
    Re: Looking for a one-liner <bwalton@rochester.rr.com>
    Re: Looking for a one-liner <peter.sundstrom@eds.com>
    Re: Looking for a one-liner <peter.sundstrom@eds.com>
    Re: MS SQL & Perl (Gwyn Judd)
    Re: Multiple fork()s? <jhscrimsher@uswest.net>
    Re: OK - I'm stupid. Please help. (Tad McClellan)
    Re: OOP and information hiding (Gwyn Judd)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 08 Nov 2000 02:08:39 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: $password = crypt($pass, ar);
Message-Id: <slrn90hdd4.hbr.tjla@thislove.dyndns.org>

I was shocked! How could Scott Zetlan <szetlan@uu.net>
say such a terrible thing:
>I must protest: storing passwords in files is a crime against man and beast.
>Or at least against information security.
>
>Better to store the encrypted password in a file, and never save the
>password itself; prompt a user for a password and encrypt it as a challenge,
>then compare the challenge to the saved encrypted password.  That way when
>(not if) someone unscrupulous finds the file, it will take a little longer
>to derive the password.

Yeah but then you are stuck if the user can't remember the password and
you have to email it to them. Of course, the whole idea of emailing
someone a password is so ridiculous from the security front I don't know
why I'm mentioning it.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Life is like an onion: you peel it off one layer at a time, and sometimes
you weep.
		-- Carl Sandburg


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

Date: Wed, 08 Nov 2000 02:34:08 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: [Way OT] Re: OOP and information hiding
Message-Id: <slrn90hesu.hbr.tjla@thislove.dyndns.org>

I was shocked! How could Abigail <abigail@foad.org>
say such a terrible thing:

>Perl lacks the glue to bind objects together. You can still build nice
>things if everyone makes lego bricks; you can also make things together
>with velcro, or by using bolts. But velcro doesn't stick to lego.
>I better make lego bricks when I want to reuse someone else lego bricks,
>and work hard if I also want to incorperate someones velcro.

Ah but what if you wrap the velcro straps around the lego blocks?

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
When I was a boy I was told that anybody could become President.  Now
I'm beginning to believe it.
		-- Clarence Darrow


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

Date: Tue, 7 Nov 2000 20:01:04 -0800
From: "HappyHippo" <thalion@wonderd.com>
Subject: DBI and mysql
Message-Id: <8uaiva$t2l$1@slb1.atl.mindspring.net>

Hi, I've got a quick question that is more mySQL related.
I'm trying to make a SQL query with DBI like this

SELECT id FROM items WHERE description LIKE $query LIMIT 0,20

what I would like to say is something like

SELECT id FROM items WHERE description LIKE $query OR title LIKE $query
LIMIT 0,20

I've used the AND, but I dont want to find the id's where  both cases exist,
I need
to get them where either cases exist. Does anyone know how I can do this?

Thanx!




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

Date: Wed, 08 Nov 2000 04:16:26 GMT
From: bowman@news.montana.com (bowman)
Subject: Re: DBI and mysql
Message-Id: <slrn90hlcn.k5m.bowman@localhost.localdomain>

HappyHippo <thalion@wonderd.com> wrote:

!I've used the AND, but I dont want to find the id's where  both cases exist,
!I need
!to get them where either cases exist. Does anyone know how I can do this?

The standard usage, which I am pretty sure is supported by MySql is

SELECT DISTINCT .......


to eliminate duplicate rows.




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

Date: Wed, 8 Nov 2000 01:55:51 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Detecting socket closure
Message-Id: <G3oo13.1u0@news.boeing.com>

In article <3A06D7AF.41C6@wecan.com>, Fulko Hew  <fulko@wecan.com> wrote:
>> Just curious but with your signal handler installed, what 
>>  do you now see with: 
>>   
>>    defined( send(...) ) || die "send $host: $!"; 
>>   
>>  Also, what does your handler look like?
>
>
>send now unblocks and returns undef.
>

Right, but if the call returns undef, you'll
get a $! return which is what I was curious
about. 

>the handler:
>
>use POSIX qw(:sys_wait_h);
>sub closer {
>    waitpid(-1, &WNOHANG);
>    $SIG{PIPE} = \&closer;     # this enables send() to be interrupted
>}                              # when the socket is closed
>

Partly what baffled me was that the usual idiom
for checking C<send> returns is the code below:

  defined( send(...) ) || die "send $host: $!"; 

You didn't use this which I would have expected
to have revealed the SIGPIPE. So, I speculated 
that your error checking might be the culprit 
and wanted to eliminate that possibility. 

Sorry if I'm missing some key ingredient here.

--
Charles DeRykus


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

Date: Wed, 8 Nov 2000 03:54:26 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Detecting socket closure
Message-Id: <G3otIq.4Ip@news.boeing.com>

In article <G3oo13.1u0@news.boeing.com>,
Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
>In article <3A06D7AF.41C6@wecan.com>, Fulko Hew  <fulko@wecan.com> wrote:
>>> Just curious but with your signal handler installed, what 
>>>  do you now see with: 
>>>   
>>>    defined( send(...) ) || die "send $host: $!"; 
>>>   
>>>  Also, what does your handler look like?
>>
>>
>>send now unblocks and returns undef.
>>
>
>Right, but if the call returns undef, you'll
>get a $! return which is what I was curious
>about. 
>
>>the handler:
>>
>>use POSIX qw(:sys_wait_h);
>>sub closer {
>>    waitpid(-1, &WNOHANG);
>>    $SIG{PIPE} = \&closer;     # this enables send() to be interrupted
>>}                              # when the socket is closed
>>
>
>Partly what baffled me was that the usual idiom
>for checking C<send> returns is the code below:
>
>  defined( send(...) ) || die "send $host: $!"; 
>
>You didn't use this which I would have expected
>to have revealed the SIGPIPE. So, I speculated 
>that your error checking might be the culprit 
>and wanted to eliminate that possibility. 
>

Actually, after checking DejaNews, I suspect you were 
correct in installing a SIGPIPE handler but something
more like this would be a better IMO: 


  {  local $SIG{PIPE} = 'IGNORE';
     defined( send(...) ) || die "send $host: $!"; 
  }

Unless I missed the boat, that'll prevent the SIGPIPE from 
terminating your program and instead C<send> will return -1 
with $! set to EPIPE  ("broken pipe"). You shouldn't have to 
do any other error checking contortions. 


hth,
--
Charles DeRykus


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

Date: Wed, 08 Nov 2000 02:15:07 GMT
From: tim@degree.ath.cx (Tim Hammerquist)
Subject: Re: HELP Winows NT Mail::Sender
Message-Id: <slrn90heo8.97m.tim@degree.ath.cx>

On Tue, 07 Nov 2000 04:41:06 GMT, Paulgee <paul.g@cableinet.co.uk> wrote:
> Hi all
>        I am trying to get script.pl to send mail from a NT server it has
> activestate installed but perl cannot find the dir where sender.pm is
> installed, is the answer to push another search location onto the @INC array
> and if so can anyone tell me the default directory or a clue where sender.pm
> is usualy installed.
> 
> I wanted to check that I am not missing something before I contact my ISP.

I used Mail::Sender on NT4/IIS4 successfully.  But from the information
you gave (and I apologize if I'm wrong) it sounds like you don't have
Mail::Sender installed.  It's not part of the standard module
distribution.

If you have installed it, try including more info in your next post,
such as the script, dir structure, etc.

-- 
-Tim Hammerquist <timmy@cpan.org>
I don't want to belong to any club
that would have me as a member.
	-- Groucho Marx


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

Date: Wed, 08 Nov 2000 02:58:13 GMT
From: "Paulgee" <paul.g@cableinet.co.uk>
Subject: Re: HELP Winows NT Mail::Sender
Message-Id: <9j3O5.12021$aT1.1168204@news3.cableinet.net>

Hi dave
            Not that fond of blat, to be honest:-(, but I will email you if
I solve it, look's like I am on a mission, however, there is another way
using socket's, but requires quite a lot of scripting and I just want
something simple to include within certain files and or call!!

thank's for your help:-)

paul

Dave E <dave_at_hm@hotmail.com> wrote in message
news:3A08971E.544A447E@hotmail.com...
> well, if you're willing to try advice from a non-expert,
>
> I tried to install Mail::Sender via ppm.pl and picked up an error message.
As
> well, use Send::Mail came up with an error (sounds like what you got too).
>
> So, I suspect the answer is that Mail::Sender is not compatible with the
Win32
> version of Perl.  Or, that something else has to be installed first.
>
> If you want a work-around, I have sent mail by shelling out to blat.exe.
A
> feeware mailer you can pick up.  If you can't get Mail::Sender working,
you
> could use this.
>
>     David...
>
> P.S.  If you do get Mail::Sender going, send me an email :)  it's cleaner
that
> blat.
>
>
> Paulgee wrote:
>
> > Hi all
> >        I am trying to get script.pl to send mail from a NT server it has
> > activestate installed but perl cannot find the dir where sender.pm is
> > installed, is the answer to push another search location onto the @INC
array
> > and if so can anyone tell me the default directory or a clue where
sender.pm
> > is usualy installed.
> >
> > I wanted to check that I am not missing something before I contact my
ISP.
> >
> > thanks
> >
> > paul
> >
> > p.s
> > I am using the following from cpan.
> >         use Mail::Sender;
> >
> >         $sender = new Mail::Sender {smtp => 'mail.yourdomain.com', from
=>
> > 'your@address.com'};
> >         $sender->MailFile({to => 'some@address.com', subject => 'Here is
the
> > file',
> >                        msg => "I'm sending you the list you wanted.",
> >                            file => 'filename.txt'});
>




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

Date: Wed, 08 Nov 2000 03:07:07 GMT
From: "Paulgee" <paul.g@cableinet.co.uk>
Subject: Re: HELP Winows NT Mail::Sender
Message-Id: <vr3O5.12045$aT1.1168159@news3.cableinet.net>

Thankyou steve
                        at least I know where it should be now, the require
5.002; doese not seem to do mutch though, and it has not solved the problem,
the active state write up say's it alter's path's and stuff I am wondering
if this could be it, and the path to c:/perl/lib/Mail is not there or the
files are not, dunno but will not give up YET :-)

more investigation methink's

again thank's
paul

Steve Jones <stevej@proact.net> wrote in message
news:3a0830db_1@nnrp1.news.uk.psi.net...
> I use sender.pm on NT. I locate it as follows (ignore GNU Unix cmds):
>
> $ pwd
> c:/perl/lib/Mail
> $ ls
> Address.pm      Field           Header.pm       Mailer.pm       Send.pm
> Alias.pm        Field.pm        Internet.pm     MessageList.pm  Sender.pm
> Cap.pm          Filter.pm       Mailer          POP3Client.pm   Util.pm
> $
>
> In the script, I say
> require 5.002;
>
> #
> # Includes
> #
> use Mail::Sender;
>
>
> #---- globals --
>
> "Paulgee" <paul.g@cableinet.co.uk> wrote in message
> news:CJLN5.9882$aT1.924969@news3.cableinet.net...
> > Hi all
> >        I am trying to get script.pl to send mail from a NT server it has
> > activestate installed but perl cannot find the dir where sender.pm is
> > installed, is the answer to push another search location onto the @INC
> array
> > and if so can anyone tell me the default directory or a clue where
> sender.pm
> > is usualy installed.
> >
> > I wanted to check that I am not missing something before I contact my
ISP.
> >
> > thanks
> >
> > paul
> >
> > p.s
> > I am using the following from cpan.
> >         use Mail::Sender;
> >
> >         $sender = new Mail::Sender {smtp => 'mail.yourdomain.com', from
=>
> > 'your@address.com'};
> >         $sender->MailFile({to => 'some@address.com', subject => 'Here is
> the
> > file',
> >                        msg => "I'm sending you the list you wanted.",
> >                            file => 'filename.txt'});
> >
> >
> >
> >
> >
>
>




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

Date: Wed, 08 Nov 2000 03:50:30 GMT
From: "Paulgee" <paul.g@cableinet.co.uk>
Subject: Re: HELP Winows NT Mail::Sender
Message-Id: <a44O5.12064$aT1.1173034@news3.cableinet.net>

> I used Mail::Sender on NT4/IIS4 successfully.  But from the information
> you gave (and I apologize if I'm wrong) it sounds like you don't have
> Mail::Sender installed.  It's not part of the standard module
> distribution.
>
> If you have installed it, try including more info in your next post,
> such as the script, dir structure, etc.
>
> --
> -Tim Hammerquist <timmy@cpan.org>
> I don't want to belong to any club
> that would have me as a member.
> -- Groucho Marx

Hi Tim
         I am beginning to think this as well, unfortunately the machine or
server that I am putting these scripts on does not belong to myself so I
cannot give the DIR structure, and I am stabbing around in the dark, the ISP
gives a Link reference to Cpan saying that the activestate installation is
the latest version, I have read most of the information there regarding
e-mail however I must admit not all of it yet, there is an awful lot to get
through:-)

 with the standard activestate installation if that is what we are talking
about, I will hopefully know soon, so my question now is what is there in
the standard installation I can call on to send e-mail from forms, if you do
not mind me asking, I can activate and send e-mail by sockets but this
requires quite a lot of scripting and I'm trying to keep this part simple.

 anyway' to be honest I'm curious now and would like to solve the problem
;-)

 thanks for your help

 Paul






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

Date: Tue, 07 Nov 2000 20:02:18 -0800
From: Dave E <dave_at_hm@hotmail.com>
Subject: Re: HELP Winows NT Mail::Sender
Message-Id: <3A08D04A.E8B851D5@hotmail.com>

>...look's like I am on a mission...

Well, I'm curious about this too.

So far, I've found that you can use PMM to install Mail-Sender from
http://rto.dk/packages.  And, after installing - "use Mail::Sender" proceeds
without error.  I haven't tried to do anything yet but it's looking promissing.

To do this, start pmm
type:  "set repository RKO http://rto.dk/packages"

Typing: "search mail"
should report Mail-Sender from RKO
as:
PPM> search mail
Packages available from http://rto.dk/packages:
        Mail-POP3Client
        Mail-Sender
        Mail-Sendmail
        MailTools
Packages available from http://www.ActiveState.com/packages:
        Mail-POP3Client
        MailTools

typing:  "install /location http://rto.dk/packages Mail-Sender"
will install the package.

Next, I'll try sending a mail message -- if you get one from me then you know it
works ;)

    David...



Paulgee wrote:

> Hi dave
>             Not that fond of blat, to be honest:-(, but I will email you if
> I solve it, look's like I am on a mission, however, there is another way
> using socket's, but requires quite a lot of scripting and I just want
> something simple to include within certain files and or call!!
>
> thank's for your help:-)
>
> paul
>
> Dave E <dave_at_hm@hotmail.com> wrote in message
> news:3A08971E.544A447E@hotmail.com...
> > well, if you're willing to try advice from a non-expert,
> >
> > I tried to install Mail::Sender via ppm.pl and picked up an error message.
> As
> > well, use Send::Mail came up with an error (sounds like what you got too).
> >
> > So, I suspect the answer is that Mail::Sender is not compatible with the
> Win32
> > version of Perl.  Or, that something else has to be installed first.
> >
> > If you want a work-around, I have sent mail by shelling out to blat.exe.
> A
> > feeware mailer you can pick up.  If you can't get Mail::Sender working,
> you
> > could use this.
> >
> >     David...
> >
> > P.S.  If you do get Mail::Sender going, send me an email :)  it's cleaner
> that
> > blat.
> >
> >
> > Paulgee wrote:
> >
> > > Hi all
> > >        I am trying to get script.pl to send mail from a NT server it has
> > > activestate installed but perl cannot find the dir where sender.pm is
> > > installed, is the answer to push another search location onto the @INC
> array
> > > and if so can anyone tell me the default directory or a clue where
> sender.pm
> > > is usualy installed.
> > >
> > > I wanted to check that I am not missing something before I contact my
> ISP.
> > >
> > > thanks
> > >
> > > paul
> > >
> > > p.s
> > > I am using the following from cpan.
> > >         use Mail::Sender;
> > >
> > >         $sender = new Mail::Sender {smtp => 'mail.yourdomain.com', from
> =>
> > > 'your@address.com'};
> > >         $sender->MailFile({to => 'some@address.com', subject => 'Here is
> the
> > > file',
> > >                        msg => "I'm sending you the list you wanted.",
> > >                            file => 'filename.txt'});
> >



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

Date: Tue, 07 Nov 2000 20:05:45 -0800
From: Dave E <dave_at_hm@hotmail.com>
Subject: Re: HELP Winows NT Mail::Sender
Message-Id: <3A08D119.F1CDDD52@hotmail.com>

> so far, I've found that you can use PMM
    opps, that's suppose to be PPM  -- sorry :)




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

Date: Tue, 7 Nov 2000 21:46:27 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help! Can't use "next LABEL" in SIG{ALRM} sub
Message-Id: <slrn90hfk3.6hh.tadmc@magna.metronet.com>

On Tue, 7 Nov 2000 20:24:29 -0000, Kingsley Tart <a@b.c> wrote:
>> BTW: This is a FAQ:
>
>Where can I get this FAQ? 


It comes with the perl distribution.

If you have perl installed correctly, then the Perl FAQs are
already on your hard disk somewhere.

Try this:

   perldoc -l perlfaq8

If that doesn't work, look for a subdir named 'pod/' under
one of the @INC dirs:

   print "$_\n" foreach @INC;


>If it's perlfunc, 


Huh?

perl ships about 50-80 *.pod files.

perlfunc.pod is one of those.

perlfaq[1-9].pod are nine others.

Your FAQ is in perlfaq8.pod.


>there must be a better way than
>trying to search for guessed-at keywords in perldoc?


That is the best way that I know of.

Supplemented by just reading all of the Question texts
once in a while:

   cd /usr/lib/perl5/5.6.0/pod
   perl -ne 'print if s/^=item \* //' perlfaq*.pod | more

There's only about 300 of them (5 "pages").

Print them out. Put them in the smallest room in your house.
Read them when you are... well, when you have time  :-)


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 7 Nov 2000 21:56:18 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to return @Array1 and @Array2?
Message-Id: <slrn90hg6i.6hh.tadmc@magna.metronet.com>

On Tue, 07 Nov 2000 20:19:58 GMT, fallenang3l@my-deja.com 
   <fallenang3l@my-deja.com> wrote:

>(@Array1,@Array2)=&sub_returning_Arrays();
>
>isn't working. If I'm told that the syntax is wrong,


If the syntax was wrong, perl would have told you (compile time error).

So the syntax is right. It is the *semantics* that is wrong.

Syntax is merely a housekeeping chore that programmers must
endure to get to what is Really Important, the _meaning_ of
the instructions that they are issuing to their computer.

I find it disheartening to see syntax syntax syntax mentioned
all the time, when it is but a boring detail!

What people should be paying attention to is what the syntax
_means_ not what it looks like.


   "The cat chased the dog."

The syntax is fine there. Nouns, verbs and whatnot in the correct place.

The semantics are likely incorrect though.


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 08 Nov 2000 02:41:35 GMT
From: "Mike Grimes" <megrimes@flash.net>
Subject: Looking for a one-liner
Message-Id: <z33O5.8175$pq3.646348@news.flash.net>

Hello All,

I have a file in which I would like to insert a newline after each \
character. For instance, if the file looks like:
77777777777\888888\9999999

I need it to look like:
77777777777\
888888\
9999999

When I use the one liner perl -ni 's/\\/\\\015/' [filename]

I end up with the ^M's in my file, but when I cat the output file, I end up
with:
77777777777\^M888888\^M9999999

Is there a one-liner that can get me where I need to be?

Thanks for the help,
Mike




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

Date: Wed, 08 Nov 2000 04:11:32 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Looking for a one-liner
Message-Id: <3A08D343.3882A46E@rochester.rr.com>

Mike Grimes wrote:
 ...
> I have a file in which I would like to insert a newline after each \
> character. For instance, if the file looks like:
> 77777777777\888888\9999999
> 
> I need it to look like:
> 77777777777\
> 888888\
> 9999999
> 
> When I use the one liner perl -ni 's/\\/\\\015/' [filename]
> 
> I end up with the ^M's in my file, but when I cat the output file, I end up
> with:
> 77777777777\^M888888\^M9999999
> 
> Is there a one-liner that can get me where I need to be?
 ...
> Mike
Try using \n in place of \015 .  \n should translate to a newline
sequence on whatever platform you are running.  \015 will be a newline
sequence probably only on a Mac.
-- 
Bob Walton


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

Date: Wed, 8 Nov 2000 17:28:15 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Looking for a one-liner
Message-Id: <8uakv2$5q3$1@hermes.nz.eds.com>


Peter Sundstrom <peter.sundstrom@eds.com> wrote in message
news:8uajjd$48p$1@hermes.nz.eds.com...
>
> Mike Grimes <megrimes@flash.net> wrote in message
> news:z33O5.8175$pq3.646348@news.flash.net...
> > Hello All,
> >
> > I have a file in which I would like to insert a newline after each \
> > character. For instance, if the file looks like:
> > 77777777777\888888\9999999
> >
> > I need it to look like:
> > 77777777777\
> > 888888\
> > 9999999
> >
> > When I use the one liner perl -ni 's/\\/\\\015/' [filename]
> >
> > I end up with the ^M's in my file, but when I cat the output file, I end
> up
> > with:
> > 77777777777\^M888888\^M9999999
>
> Which is exactly what you specified.
>
>
> > Is there a one-liner that can get me where I need to be?
>
> perl -pe 's/\\/\n/g' file

Sorry, should be:

perl -pe 's/\\/\\\n/g' file

or

perl -pe 's!(\\)!\1\n!g' file

or

perl -ne 'print join("\n",/\d+\\*/g)' file






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

Date: Wed, 8 Nov 2000 17:04:58 +1300
From: "Peter Sundstrom" <peter.sundstrom@eds.com>
Subject: Re: Looking for a one-liner
Message-Id: <8uajjd$48p$1@hermes.nz.eds.com>


Mike Grimes <megrimes@flash.net> wrote in message
news:z33O5.8175$pq3.646348@news.flash.net...
> Hello All,
>
> I have a file in which I would like to insert a newline after each \
> character. For instance, if the file looks like:
> 77777777777\888888\9999999
>
> I need it to look like:
> 77777777777\
> 888888\
> 9999999
>
> When I use the one liner perl -ni 's/\\/\\\015/' [filename]
>
> I end up with the ^M's in my file, but when I cat the output file, I end
up
> with:
> 77777777777\^M888888\^M9999999

Which is exactly what you specified.


> Is there a one-liner that can get me where I need to be?

perl -pe 's/\\/\n/g' file





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

Date: Wed, 08 Nov 2000 02:15:26 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: MS SQL & Perl
Message-Id: <slrn90hdps.hbr.tjla@thislove.dyndns.org>

I was shocked! How could Rich Parker <RichParker@fssi-ca.com>
say such a terrible thing:
>But that still leaves my last question unanswered: What about the
>'make' after the 'perl makefile.pl', how did the rest of you get around
>that w/o having a Unix Shell???  HELP!!

I have a unix shell so that bit never really applied to me. I think you
can get make for windows though. Or failing that you can get activeperl
(or whatever it's called). I'm not really sure why you need to do a
'make' anyway, Perl doesn't require it, unless you are trying to install
something I guess. Is that what you are trying to do? Maybe you should
split this out into seperate tasks because it seems like you are trying
to do too many things at once.

And, please, please post your replies below the text that you are
replying to, and trim the text you are replying to down to a bare
minimum. Thanks.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Two percent of zero is almost nothing.


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

Date: Tue, 7 Nov 2000 18:44:19 -0800
From: "John S" <jhscrimsher@uswest.net>
Subject: Re: Multiple fork()s?
Message-Id: <i53O5.3819$b5.329642@news.uswest.net>


"Martien Verbruggen" <mgjv@tradingpost.com.au> wrote in message
news:slrn90hbbo.7ck.mgjv@verbruggen.comdyn.com.au...
> [Please, in the future, post your reply after the text you reply to.
> It's the comman practice on this group, and Usenet in general]
>
> On Tue, 7 Nov 2000 15:24:40 -0800,
> John S <jhscrimsher@uswest.net> wrote:
> > "Ilya Zakharevich" <ilya@math.ohio-state.edu> wrote in message
> > news:8u9r9g$r4n$1@charm.magnus.acs.ohio-state.edu...
> >> Do not you need
> >>
> >>   do { wait for 1..200 } if $procCount % 200 == 0;
> >>
> >> ?
>
> > unless I mis-understand, this will wait for a count of 1 to 200, not
> > wait until all children are dead.  I want to do a set number of
> > forks (200), then wait for all of them to die and then do another
> > 200.
>
> It will wait() 200 times. The same number of times are you have
> forked. That's what's needed. You could also do it through a signal
> handler, see perlipc.
>
> Martien
> --
OK,

Thank you very much for the help and the explanations.  It does appear to do
what I want when I tested it.

John




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

Date: Tue, 7 Nov 2000 22:04:13 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: OK - I'm stupid. Please help.
Message-Id: <slrn90hgld.6hh.tadmc@magna.metronet.com>

On Tue, 7 Nov 2000 14:58:07 -0800, GC <geoff@800-800-cruise.com> wrote:

>Thanks. I'll try that too - and will work on the titling. Frustration
>occasionally presents awkwardly. :}


But note that letting your frustration ruin your subject line
greatly diminished the probability of getting an answer...

 ... so you get yet more frustration.

You can whine and whinge (but just a bit please :-) in the
_body_ of your message, but don't do it in your Precious
40 Characters of Subject (P40CoS).

(and don't waste characters with pleading either)


Your post is in competition with 100-300 other posts each day.
Nobody reads all of them. 

The ones with the best Subjects win (the others lose).


-- 
    Tad McClellan                          SGML consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Wed, 08 Nov 2000 02:30:01 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: OOP and information hiding
Message-Id: <slrn90hel6.hbr.tjla@thislove.dyndns.org>

I was shocked! How could Joe Schaefer <joe+usenet@sunstarsys.com>
say such a terrible thing:
>abigail@foad.org (Abigail) writes:
>
>> But that's the problem, isn't it? It isn't in the language, for the
>> safe guard to work, you have to rely on the interface.
>
>I disagree. IMHO you rely on the documentation.  If you build a 
>module and intend for it to be inherited, you should document 
>the attributes you use, just as you would with public variables 
>in any other OO language.  I would consider it a bug in the 
>documentation otherwise.

Sure, but you shouldn't have to document the *private* variables that
you use as well. That's what makes them, well, private.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
"Time is an illusion.  Lunchtime doubly so."
-- Ford Prefect, _Hitchhiker's Guide to the Galaxy_


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

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


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