[22010] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4232 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 8 11:05:46 2002

Date: Sun, 8 Dec 2002 08:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 8 Dec 2002     Volume: 10 Number: 4232

Today's topics:
    Re: [OT] Re: Future of Perl as an application server la (Randal L. Schwartz)
    Re: A formating problem <goldbb2@earthlink.net>
    Re: backreference behavior and other weirdness, what's  <tassilo.parseval@post.rwth-aachen.de>
        CGI.pm   uploaded file size is smaller than original on <ahj6@hotmail.com>
    Re: CGI.pm   uploaded file size is smaller than origina <dave@dave.org.uk>
    Re: Creating TCP Sockets -- Client Can't Find Server <hal@thresholddigital.com>
    Re: Help Im losing faith! VERY JUICY PROBLEM! (LazyPerfectionist)
        How to substitute ' by \' (Francesco Moi)
    Re: How to substitute ' by \' <julian@mehnle.net>
    Re: How to substitute ' by \' <dave@dave.org.uk>
    Re: io::socket::inet / tcp question <spam@thecouch.homeip.net>
    Re: Is there a better way of doing this? <philip@zaynar.demon.co.uk>
    Re: Need help with file output/editing - newbie (Tad McClellan)
    Re: Newbie help please !! (Tad McClellan)
    Re: Newbie help please !! <dave@dave.org.uk>
        Port counts using Perl and SNMP commands <kmelrose@kc.rr.com>
    Re: Port counts using Perl and SNMP commands <mgjv@tradingpost.com.au>
    Re: porting a routine which uses uint32_t (Sisyphus)
        search reorder replace <nospamjynyl@yahoo.co.nz>
    Re: search reorder replace (Anno Siegel)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 07 Dec 2002 20:17:42 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: [OT] Re: Future of Perl as an application server language?
Message-Id: <86el8tywih.fsf@red.stonehenge.com>

>>>>> "Simon" == Simon  <simonf@simonf.com> writes:

Simon> Apologies to Randal for the misspelling. 

s'ok

Simon> I will definitely be killfiled by him after this posting.

Really?  Have I even suggested that?  Nahh.

print "Just another Perl hacker,"
-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sat, 07 Dec 2002 21:13:37 -0500
From: Benjamin Goldberg <goldbb2@earthlink.net>
Subject: Re: A formating problem
Message-Id: <3DF2AAD1.D31C0170@earthlink.net>

Jeff 'japhy' Pinyan wrote:
[snip]
>   # step 2 -- convert hash of array-references
>   # into array of array-references
> 
>   @points = (
>     [ keys %data ],
>     [ values %data ],
>   );

ITYM:

    my @sorted_keys = sort keys %data;
    @points = (
      \@sorted_keys,
      [ map [sort {$a <=> $b} @$_], @data{@sorted_keys} ],
    );

-- 
$..='(?:(?{local$^C=$^C|'.(1<<$_).'})|)'for+a..4;
$..='(?{print+substr"\n !,$^C,1 if $^C<26})(?!)';
$.=~s'!'haktrsreltanPJ,r  coeueh"';BEGIN{${"\cH"}
|=(1<<21)}""=~$.;qw(Just another Perl hacker,\n);


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

Date: 8 Dec 2002 08:39:26 GMT
From: "Tassilo v. Parseval" <tassilo.parseval@post.rwth-aachen.de>
Subject: Re: backreference behavior and other weirdness, what's happening?
Message-Id: <asv0fu$4mg$1@nets3.rz.RWTH-Aachen.DE>

Also sprach eric:

>>     if (/^(AC#(?:[3-9]|10|11),/) {
>>         print SAVED $1;
>>     } else {
>>         print OUTPUT;
>>     }
> 
> this crashes because the parenthesis are mismatched.  if you add the missing
> closing parenthesis, $1 just contains "AC#4," whereas i think the aim is to
> capture the entire line, you could do that with
> 
>     if (/^(AC#(?:[3-9]|10|11),.*)$/s) {
> 
> where .* captures the rest of the line and the s modifier tells . to pick up
> the newline as well.

Yes, right, I somehow screw the whole if-condition. Just now I came to
realize that the OP isn't extracting a substring at all. He captures the
whole line which is wasteful in this context. A better way to switch
between two filehandles would be:

    while (<HANDLE>) {
        select /^AC#(?:[3-9]|10|11),/ ? SAVED : OUTPUT;
        print;
    }

or perhaps even

    print { /^AC#(?:[3-9]|10|11),/ ? SAVED : OUTPUT } $_
        while <HANDLE>;

Tassilo
-- 
$_=q!",}])(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;


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

Date: Sun, 8 Dec 2002 23:17:00 +0900
From: "Hyungjin Ahn" <ahj6@hotmail.com>
Subject: CGI.pm   uploaded file size is smaller than original one. help
Message-Id: <asvioc$ado$1@news1.kornet.net>

I uploaded abcd.jpg and saved it in the server fold as xxx.jpg. When
compared, abcd.jpg = 78,526bytes and xxx.jpg = 77,824bytes;

xxx.jpg was well showed the same image to the original one, but why are the
sizes of both different?

thanks in advance!

- Hyungjin Ahn(ahj6@hotmail.com)






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

Date: Sun, 08 Dec 2002 15:57:03 +0000
From: "Dave Cross" <dave@dave.org.uk>
Subject: Re: CGI.pm   uploaded file size is smaller than original one. help
Message-Id: <pan.2002.12.08.15.57.02.529766@dave.org.uk>

On Sun, 08 Dec 2002 23:17:00 +0900, Hyungjin Ahn wrote:

> I uploaded abcd.jpg and saved it in the server fold as xxx.jpg. When
> compared, abcd.jpg = 78,526bytes and xxx.jpg = 77,824bytes;
> 
> xxx.jpg was well showed the same image to the original one, but why are the
> sizes of both different?

At a guess you need to read the docs for "binmode".

Dave...

-- 
  ...she opened strange doors that we'd never close again



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

Date: Sun, 08 Dec 2002 06:35:32 GMT
From: Hal Vaughan <hal@thresholddigital.com>
Subject: Re: Creating TCP Sockets -- Client Can't Find Server
Message-Id: <UKBI9.278298$QZ.41610@sccrnsc02>

ARrrggghhhh!

Thanks for pointing that out.  I had proofed it several times.  I've found 
whenever I have serious trouble with a script, it's almost always a typo.  
My vision checks out okay, but I can stare at a line and even read it 
letter by letter and just not see a typo.  (I had to re-read the two lines 
over, letter by letter, 3 times to see the difference was in a capitalized 
"P".)

I tried it with that one letter changed and it worked!

I think it would have been easier to figure out it was a typo if I were more 
familiar with sockets (I'm just learning the subject-- can you tell?).

Thanks!

Hal



Garry Williams wrote:

> On Thu, 05 Dec 2002 01:12:19 GMT, Hal Vaughan <hal@thresholddigital.com>
> wrote:
> 
> [snip]
> 
>> I've copied examples out of the Blue Camel,
> 
> But not flawlessly, it appears.  :-)
> 
> [snip]
> 
>>                         Localport => $serverport,
> 
> LocalPort => $serverport,
> 



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

Date: 8 Dec 2002 06:14:15 -0800
From: mod3@hotmail.com (LazyPerfectionist)
Subject: Re: Help Im losing faith! VERY JUICY PROBLEM!
Message-Id: <4379a3c8.0212080614.fea46a7@posting.google.com>

mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow) wrote in message news:<astejm$1oj$1@wisteria.csv.warwick.ac.uk>...
> mod3@hotmail.com (LazyPerfectionist) wrote:
> >Here is another one for u...
> >What if I do this 
> >
> >$h_data{$lineNo}->{\%{$a_header[$i]}} =
> 
> You don't need this ->: it is implied between {} and [] sets.
> \%{...} does precisely nothing: it derefs the reference in ... and then
> immediately takes it's reference. [1]
> 
> >        defined $values[$i]?$values[$i]:'';
> >
> >The second $h_data key is now a reference to the hashes in the
> >$a_header!
> 
> No it isn't. A hash key is just a string, not an SV, so it can't be a 
> reference. What it will be instead is something like 'HASH(0x9122b38)', from 
> which you _cannot_ retreive the original reference.
> 
> >the problem now is:-
> >
> >foreach $ky (keys %HoH_data){
> >    foreach $vl (keys %{$HoH_data{$ky}}){
> >	print(keys $vl,"--\n");
> >}};
> >I cant get access to the hashref contained in the $vl
> 
> No. It isn't a hashref: it's just a string. (I presume HoH_data is defined 
> like h_data above?)
> 
> >this works! but again thats not the point..
> >
> >foreach $ky (keys %HoH_data){
> >    for (0..$#AoH_header){
> >	$HoH_data{$ky}{$_};
> >}};
> 
> Er, what exactly does this do? Other than evaluate $HOH_data{$ky}{$_} in a
> void context, that is...
> 
> >I know I could make my life very easy using the Tie:: ...
> 
> No, I don't think you could.
> 
> >What I eventualy want to do is have the second key evaluate the
> >data...but lets take it one step at a time...
> 
> I think perhaps if you explained carefully what you are trying to acheive 
> we may be able to see some way of doing it, as the solution you are trying
> (storing a ref in a hash key) is impossible :)
> 
> Ben
> 
> [1] Yes, OK, it checks that $a_header[$i] is indeed either an array or a hash 
> ref. Not, I think, the intention here.

Im trying to do a look up table...eg

data set in file 
                  #SUBJECT NAME MARK
                  FRENCH JANE 83
                  ...etc

I want the %data to contain 
                  SUBJECT = FRENCH
                  NAME = JANE
                  MARK = 83
                  etc...

So when I read it from a file I use the header as a look up table
                  SUBJECT = ^(FRENCH|ENGLISH|MATHS)
                  NAME = \b[A-Z]+\b
                  etc..

the data key1 contains the line no 
                  %data{$lineno}

the data key2 contains the headings 
                  $data{$lineno}{SUBJECT} = $values[0]

So I thought later I could do something like this
             for $lineno (keys %data)
              for(0..#header)
               if( $data{$lineno}{$_} !~ /values header{$_}/)
                print (not valid)

            or better 

             for $lineno (keys %data)
              if($data{$lineno}{keys %{$i}} !~ /values %{$i}/)
               print (experimental idea)

in the first case I would have to take the %data along with the header
but in the second case the %data has all I need...

What Im trying to achieve is a way to reduce the use of loops by
letting the hash do everything...

Is there a way to map 'HASH(0x9122b38)'?

Im i thinking about this the wrong way?

p.s. thanks for your patience ben...


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

Date: 8 Dec 2002 06:12:58 -0800
From: francescomoi@europe.com (Francesco Moi)
Subject: How to substitute ' by \'
Message-Id: <5b829932.0212080612.3b8f44fd@posting.google.com>

Hello.

I'm trying to substitute the character ' by \' into a string:

if ($text =~ /\'/) { 
   $text =~ s/\./\\\./g;
}

But it does not work for me.

Any suggestion? Thank you very much.


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

Date: Sun, 8 Dec 2002 15:39:25 +0100
From: "Julian Mehnle" <julian@mehnle.net>
Subject: Re: How to substitute ' by \'
Message-Id: <asvlit$tn9fs$1@ID-65075.news.dfncis.de>

Francesco Moi <francescomoi@europe.com> wrote:
> I'm trying to substitute the character ' by \' into a string:
> 
> if ($text =~ /\'/) { 
>    $text =~ s/\./\\\./g;
> }
> 
> But it does not work for me.

Try

  $text =~ s/\'/\\\'/g;

No "if" necessary. Or, if you want to escape a set of _multiple_ caracters:

  $text =~ s/([\'\"])/\\$1/g;

Julian.




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

Date: Sun, 08 Dec 2002 15:56:09 +0000
From: "Dave Cross" <dave@dave.org.uk>
Subject: Re: How to substitute ' by \'
Message-Id: <pan.2002.12.08.15.56.08.907892@dave.org.uk>

On Sun, 08 Dec 2002 06:12:58 +0000, Francesco Moi wrote:

> Hello.
> 
> I'm trying to substitute the character ' by \' into a string:
> 
> if ($text =~ /\'/) { 
>    $text =~ s/\./\\\./g;
> }
> 
> But it does not work for me.

Why are you escaping the single quote? You have to escape the backslash as
it's a metacharacter, but the single quote isn't.

There's also no need to check for the existance of single quotes before
doing the substitution.

$text =~ s/'/\\/g;


hth,

Dave...

-- 
  Brian: Oh screw Maximilian!
  Sally: I do.
  Brian: So do I.



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

Date: Sun, 08 Dec 2002 00:48:01 -0500
From: Mina Naguib <spam@thecouch.homeip.net>
Subject: Re: io::socket::inet / tcp question
Message-Id: <3DF2DD11.3050801@thecouch.homeip.net>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1



smackdab wrote:
|>The book is correct.  TCP/IP does not have any provisions for polling
|>both sides of the connection, which is why many programs incorporate,
|>within their internal protocol, a ping-pong command or so.
|>
|>If that is not feasible in your situation, then another alternative is
|>to assume (or make) the client always send you something within X amount
|>of time.  The server then keeps track of when was the last time they've
|>heard from a client, and drop the inactive ones.
|>
|
| Thanks, do you know if can_write() works this way also?  How would it
| know the other side can be written to without sending or checking somehow?
| If that is the case, can I tell when the process died this way?

I don't believe can_write() will do anything like that.. There's a good
chance it's main purpose is to tell you weather there's room in the
socket buffer for you to write something to it, or not.  It does not
necessarily mean (or guarantee) that what you write upon it's succcess
will make it to the other side.

The best way would be for you to write small client-server test programs
and test it out.  Pulling out an ethernet cable might be the easiest way
to simulate the other end "disappearing".

-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE98t0QeS99pGMif6wRAppXAJ4jndZn8aIlq/GPKQ9QsSTctI+IGQCfYWJL
cR12Yq5O3w5sZ/Cfbu4nbI4=
=G6dP
-----END PGP SIGNATURE-----



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

Date: Sun, 8 Dec 2002 15:13:03 +0000
From: Philip Taylor <philip@zaynar.demon.co.uk>
Subject: Re: Is there a better way of doing this?
Message-Id: <3EXT7BA$F289Ewq4@zaynar.demon.co.uk>

In article <slrnav2mf3.31l.tadmc@magna.augustmail.com>, Tad McClellan
<tadmc@augustmail.com> writes

>> my @EMPTYARRAY[100];
>
>
>That is not a "better" way of doing it. 
>
>It is not even _a_ way of doing it.

Several times I've wanted to do something similar to that, mainly in
circumstances like:

    my (@colour[0..2], $x, $y) = unpack C3SS => $data;

which perl doesn't like ('Can't declare array slice in "my"'), so I have
to split it into two lines:

    my (@colour, $x, $y);
    (@colour[0..2], $x, $y) = unpack C3SS => $data;

which can get quite messy when there are lots of variables.
'my (...) = ...' seems to work for all other types of declaration-and-
assignment, so is there a reason why this case is unimplemented? Perl
should be able to create an empty array, then use the array slice for
the assignment.
'my @emptyarray[0..99]' would create an array, then assign undef to 100
elements. But 'my @emptyarray[100]' would create @emptyarray and then
put undef into the 101st element, presumably filling the intermediate
values with undef, resulting in an array with one more element than a C
programmer would expect, which could get confusing...

-- 
Philip Taylor
philip@zaynar.demon.co.uk


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

Date: Sat, 7 Dec 2002 21:31:35 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Need help with file output/editing - newbie
Message-Id: <slrnav5f8n.4gs.tadmc@magna.augustmail.com>

unixfox <unixfox@planetlink.net> wrote:

> Any way to create an output table in something like FrontPage? 


This is not the FrontPage newsgroup.


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


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

Date: Sat, 7 Dec 2002 21:33:23 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Newbie help please !!
Message-Id: <slrnav5fc3.4gs.tadmc@magna.augustmail.com>

HelpMe <wenglennSPAM@ozemail.com.au> wrote:

> Subject: Newbie help please !!


You will get more help if you could take the trouble to put
the subject of your article in the Subject of your article.


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


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

Date: Sun, 08 Dec 2002 10:57:49 +0000
From: "Dave Cross" <dave@dave.org.uk>
Subject: Re: Newbie help please !!
Message-Id: <pan.2002.12.08.10.57.49.445707@dave.org.uk>

On Sun, 08 Dec 2002 10:25:11 +1000, HelpMe wrote:

> Please Help , i built a website and installed a members password management
> perl script, but it needs cgi.pm installed my host doesn't seem to have it
> installed and i havn't got permissions to the perl directery. and i need
> help to install it , remember i havn't any idea what i am doing when you try
> 2 explain it to me ,thanks in advance

If you don't have CGI.pm then your Perl installation is either very old or
very broken.

Either way it shouldn't be used and you should look into getting a better
one.

Dave...

-- 
  Two slightly distorted guitars



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

Date: Sun, 8 Dec 2002 03:23:58 -0600
From: "Ken" <kmelrose@kc.rr.com>
Subject: Port counts using Perl and SNMP commands
Message-Id: <G8EI9.45903$Fi7.643501@twister.kc.rr.com>

Need help!



Using a Perl script (which I'm not very familiar with) to execute SNMP
commands to retrieve specific information from all my network elements.  For
instance, total, available and unavailable number of physical ports.



My challenge is this - I need to query each device (router, switch, hub,
etc.) in my network and get the following information.



Total # of 'physical" Ports (based on chassis and cards)

Total # of "available" Ports (something connected)

Total # of "unavailable" Ports (nothing connected)



Then I need to be able to break this information down by device type.



For example, 4000 router 2-Enet cards (interfaces); 20-Ports (total
capacity); 6-Available (nothing connected); 14-Unavailable (something
connected).



I'm looking form someone that has already done this so I do not have to
re-invent the wheel.  I currently use HP OpenView and CiscoWorks 2000, but
they cannot seem to provide this type of information.



I would greatly appreciate any help or feedback.  Thank you!




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

Date: Sun, 8 Dec 2002 20:58:51 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Port counts using Perl and SNMP commands
Message-Id: <slrnav65ur.aid.mgjv@martien.heliotrope.home>

On Sun, 8 Dec 2002 03:23:58 -0600,
	Ken <kmelrose@kc.rr.com> wrote:
> Need help!

See my answer in clp.modules.

Next time, if you need to post the same question to multiple groups,
please crosspost, instead of multi-post.

Martien
-- 
                        | 
Martien Verbruggen      | 
                        | Curiouser and curiouser, said Alice.
                        | 


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

Date: 7 Dec 2002 23:05:51 -0800
From: kalinabears@hdc.com.au (Sisyphus)
Subject: Re: porting a routine which uses uint32_t
Message-Id: <e615828f.0212072305.55a9c25e@posting.google.com>

fishbowl@m0x0.conservatory.com () wrote in message news:<3df15ae3_3@corp.newsgroups.com>...
> Greetings,
> 
> I am trying to port a routine that depends on the
> behavior and precision of uint32_t.  It's a hash
> routine uses integer multiplication, xor, and modulo.
> I believe the problem is that the value depends on 
> overflowing the precision of the int, which I believe
> makes it very architecture-specific.  Nevertheless, I 
> wish to duplicate the behavior in perl on the same platform.
> 
> To implement this in perl I've tried: 
> 
>     natve scalar types -- different overflow behavior from uint32_t
> 
>     Math::BigInt -- does not overflow and thus gives me different results
>         -- while I was writing this, I thought of AND-ing with a BigInt(ffffffff')
>            to limit precision, will try that next...
> 
>     unpack(pack) with various formats -- haven't found a combination that works
> 
>     XS -- I still have the problem of representing a uint32_t for the return value.
> 
> 
> Any suggestions would be greatly appreciated!  
>     

Might the Inline::C module be of some use here ?
Presumably your compiler can make sense of the uint32_t type, so
perhaps you can write the functions in C, and have the Inline module
incorporate those functions into your perl script/module.

There still remains the problem of returning a value that perl
understands. The more knowledgeable people on the Inline mailing list
( Inline@perl.org - see http://lists.perl.org ) might be able to help
with that (and other nitty-gritty problems) if you decide to try
something along those lines.

Is the uint32_t type defined by some C library that you're using ? If
that library has a function that converts the uint32_t type (or the
relevant information it contains) to a standard ANSI C type then you
should be able to achieve what you want. I doubt that you will be able
to directly return this uint32_t type directly to perl unless,
perhaps, you go delving into the world of typemaps. Rather, I envisage
that you will use some function in the library to place the
information held by the uint32_t into an ANSI C type, and return
*that* to perl (in the form of the appropriate "perlapi" type). Does
the function need to return something? (So much simpler if it simply
printf's the result :-)

Basically Inline::C takes your C code, autogenerates xs code from your
C code, and then automatically compiles. So this is still an xs-type
solution. But as long as you can write C code, you can use that code
in perl without having to learn any xs stuff. (You might still have to
use "perlapi" equivalents for some types and functions in that C code.
See perldoc perlapi and the Inline::C cookbook.)

Sort of depends on how much stuffing about you're prepared to do :-)

Hth.

Cheers,
Rob


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

Date: Sun, 08 Dec 2002 19:52:38 +1300
From: Peter <nospamjynyl@yahoo.co.nz>
Subject: search reorder replace
Message-Id: <asuq7r$tbs3r$1@ID-132751.news.dfncis.de>


I have a 2MB file in which I want to replace every occurance of
xx 00 00 00 00
with
0a xx
where xx is hex for an ascii letter.  This letter varies, but I need to 
retain whatever it is in each case.  About 6000 instances in the file.

Is perl the right tool for this sort of job?
I've never tried perl before.  I can get scripts to go, but would appreciate 
some hints on the above task.

TIA

Peter



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

Date: 8 Dec 2002 10:19:39 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: search reorder replace
Message-Id: <asv6br$ks3$1@mamenchi.zrz.TU-Berlin.DE>

According to Peter  <nospamjynyl@yahoo.co.nz>:
> 
> I have a 2MB file in which I want to replace every occurance of
> xx 00 00 00 00
> with
> 0a xx
> where xx is hex for an ascii letter.  This letter varies, but I need to 
> retain whatever it is in each case.  About 6000 instances in the file.

Whatever this means in detail, it seems to involve matching and replacing
text.

> Is perl the right tool for this sort of job?

Perl can certainly do it, as well as other tools like sed and awk and
perhaps even you text editor.  Which one is the right tool for the job
depends on a lot of things.

> I've never tried perl before.  I can get scripts to go, but would appreciate 
> some hints on the above task.

Your description of the task is less than clear, but you will want to
look into Perl's substitution operator s///.  Maybe s/(.)\0\0\0\0/\n$1/
is what you want, but that's just a guess.

Anno


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

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


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