[28235] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9599 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 13 21:06:00 2006

Date: Sun, 13 Aug 2006 18:05:04 -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           Sun, 13 Aug 2006     Volume: 10 Number: 9599

Today's topics:
            LWP::UserAgent question--MULTIPOSTED usenet.cop@3955291010.com
        Beginner: read and print same file <mstep@t-online.de>
    Re: Beginner: read and print same file <mgarrish@gmail.com>
    Re: Beginner: read and print same file <mgarrish@gmail.com>
    Re: Beginner: read and print same file <bik.mido@tiscalinet.it>
    Re: Beginner: read and print same file <mstep@t-online.de>
    Re: Beginner: read and print same file <mgarrish@gmail.com>
    Re: Beginner: read and print same file <uri@stemsystems.com>
        creating a datastructure from lists <sal.x.lopez@gmail.com>
    Re: creating a datastructure from lists <mritty@gmail.com>
    Re: does it matter whether References headers are folde <anon@comments.header>
    Re: Encrypt Windows Password <hjp-usenet2@hjp.at>
        LWP::UserAgent question <a@mail.com>
    Re: PerlDoc used in CPAN?--MULTIPOSTED <bik.mido@tiscalinet.it>
    Re: PerlDoc used in CPAN?--MULTIPOSTED <mritty@gmail.com>
    Re: PerlDoc used in CPAN?--MULTIPOSTED <mgarrish@gmail.com>
        RegEx question: Exclude characters from group <NO_SPAM@NoOneKnows.invalid>
    Re: system command won't let go rallabs@adelphia.net
    Re: system command won't let go rallabs@adelphia.net
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 13 Aug 2006 19:26:18 -0500
From: usenet.cop@3955291010.com
Subject:     LWP::UserAgent question--MULTIPOSTED
Message-Id: <kpednfFEPfW3XkLZnZ2dnUVZ_76dnZ2d@giganews.com>

"a" <a@mail.com> wrote:
>> [ snip and ignore MULTIPOSTED message ]

**********************************************************************
**********   PLEASE  DO  NOT  RESPOND  TO  THIS  THREAD    ***********
**********************************************************************

This message has been multiposted as indicated by these message IDs:
   <JoPDg.386093$Mn5.194189@pd7tw3no>
   <GbPDg.382930$iF6.158066@pd7tw2no>

This is the 1st auto-detected multiposted message by this author.

######################################################################
# TO THE USENET COMMUNITY: This message has been multiposted, which  #
# is universally considered rude. Therefore, it is requested that    #
# you DO NOT reply to this thread. Doing so only encourages rudeness.#
#                                                                    #
# NOTE: This "Multipost Detector" has been recently-deployed as a    #
# service to the Perl community.  Questions or comments are welcome  #
# (just reply to this message). See the NAQ at the end of this post. #
######################################################################

######################################################################
# TO THE ORIGINAL POSTER (OP): You have posted a multiposted message.#
# (see below for an explanation of what that is and why it is bad).  #
# Many regular participants in technical newsgroups will not respond #
# to a multiposted message if they realize it is multiposted.        #
#                                                                    #
# This thread is therefore (probably) burned (meaning you won't get  #
# any helpful replies). If you wish, you may open a new thread which #
# conforms to ordinary standards of usenet etiquette (see below).    #
#                                                                    #
# This is NOT a flame. This is a COURTESY notice to usenet & the OP. #
# Other participants are respectfully requested to NOT flame, ignore #
# or killfile the OP unless s/he persists in multiposting.           #
######################################################################

######################################################################
# WHAT IS MULTIPOSTING ?  If you post the same question to two (or   #
# more) different newsgroups as separate messages (without           #
# indicating that you have done so) then you have multiposted. This  #
# is NEVER an acceptable practice in usenet. There are two things    #
# which will get you killfiled in a hurry--you can flame a respected #
# group participant (like flaming Randal in a Perl group) or you can #
# multipost.  These are usenet mortal sins which you should avoid if #
# you wish to have a productive usenet experience.                   #
#                                                                    #
# WHY IS MULTIPOSTING RUDE? A question posted in one newsgroup might #
# receive a prompt and expert reply, because some nice person is     #
# kind enough to provide this assistance (free of charge). However,  #
# if the question is multiposted to another newsgroup, ANOTHER nice  #
# person might spend his/her time providing the SAME assistance,     #
# unaware that the question has ALREADY been answered elsewhere.     #
# This WASTES THE TIME of the second person, who was only trying to  #
# be helpful but was actually 'tricked' into wasting his/her time.   #
# The second person has NO WAY to know the question was multiposted  #
# (and already answered) elsewhere unless s/he happens to visit the  #
# other group and notice the multipost (before replying).            #
#                                                                    #
# Most new posters are given the benefit of doubt and are assumed    #
# to have violated these conventions due to a lack of understanding. #
# Posters who persist in such behavior, however, will likely be      #
# flamed, ignored, and/or killfiled by regular group participants.   #
######################################################################

######################################################################
# ABOUT THIS REPLY: This reply was posted by an automated process    #
# which scans selected newsgroups for evidence of multiposting.      #
#                                                                    #
# This is a service to the usenet community to let folks know when   #
# a message has been multiposted.  Many folks prefer not to reply    #
# to such messages, but they might do so 'accidentally' because      #
# they don't realize the message is multiposted.                     #
#                                                                    #
# This reply is also a service to the OP (it is not an attempt to    #
# be "mean" to the OP). Hopefully the OP will become more aware of   #
# usenet etiquette. Someone who takes offense at helpful correction  #
# will probably not have a very satisfying usenet experience.        #
######################################################################

######################################################################
# WHEN/HOW IS MULTIPOSTING OK?  If you post in one newsgroup         #
# but later realize (for whatever reason) that you would prefer to   #
# post the message elsewhere, it is OK to do so provided your new    #
# message references your original post (preferably with a link).    #
# You should also respond to your original post indicating it has    #
# been re-posted elsewhere (preferably with a link). This gives both #
# newsgroup communities visibility to the others' work. If you post  #
# in this manner, this process will NOT flag it as multiposted.      #
######################################################################

######################################################################
# REFERENCES:  The following information may be helpful:             #
#   http://www.faqs.org/faqs/usenet/primer/part1/                    #
#   http://www.catb.org/~esr/faqs/smart-questions.html               #
#   http://web.presby.edu/~nnqadmin/nnq/nquote.html                  #
#   http://www.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html #
######################################################################

######################################################################
# WHY DOES THIS AUTOMATED PROCESS EXIST?  Mainly because of Google   #
# Groups.  GG has made it very easy for anybody to post anything in  #
# usenet (and many GG users don't know much about usenet, and may    #
# not even realize they're posting to a worldwide network which has  #
# nothing to do with Google). Many folks (especially GG users) are   #
# not familiar with usenet etiquette conventions and thus annoy      #
# other participants (the very people whom they are asking for help).#
# This is counterproductive to both the OP and the usenet community  #
# at large. Posters are encouraged to consult the references above   #
# to learn how to ask a good question in a polite manner; doing so   #
# is beneficial to everyone (especially the OP).                     #
######################################################################

######################################################################
# NAQ (the Never Asked Questions - TEMPORARY SECTION)                #
# Q-What ruleset defines a multipost? A--Two MD5 digests are         #
#   calculated (one forwards, one backwards) on the message body     #
#   and stored in a small database. If a new post (new message ID)   #
#    matches these digests, it's a multipost. Author and subject     #
#    lines are not taken into account. Reply messages are ignored.   #
# Q-Are crossposts flagged?  A--No. A message must have an identical #
#   body but a unique message ID to be flagged. A crosspost which is #
#   ALSO multiposted, however, will be flagged.  I may one-day add   #
#   the ability to post a much milder message for crossposts between #
#   Perl groups (it is rarely, if ever, appropriate to crosspost     #
#   between similar groups, and such crossposting is discouraged).   #
# Q-What groups are scanned? A-The main Perl Groups in Google Groups,#
#   namely: comp.lang.perl.misc, perl.beginners, perl.dbi.users,     #
#   comp.lang.perl.modules , perl.beginners.cgi, and alt.perl        #
# Q-You dummy, it's EASY to defeat this scanner! A--Of course it is. #
#   But it's rare to see multiposts which differ in the message body.#
#   An author who deliberately tweaked the content to defeat a scan  #
#   reveals his/her deliberately rude intent (& should be killfiled) #
# Q-Why am I doing this? A--For a better usenet. Some folks try to   #
#   discourage job postings; some discourage off-topic posts. I try  #
#   to discourage multiposts - that's my little pet peeve (and,      #
#   unlike OT posts and the like, it's not obvious when it happens)  #
#   If you don't wish to be bothered with these auto-generated       #
#   responses, please killfile the scanner.                          #
# Q-Who wrote this program? A-- I am not trying to keep my identity  #
#   a big secret (it's easy enough to find out who I am, and group   #
#   regulars probably recognize my rants). But I choose to run this  #
#   scanner anonymously because some posters will be determined to   #
#   take offense at this. If they get mad at me, their anger may     #
#   spill over into future postings that I participate in. I just    #
#   get tired of newbies pitching tantrums any time someone offers   #
#   friendly and helpful correction, so I deny them an easy target.  #
#                                                                    #
#   I will reply (under my own handle) to questions or comments      #
########
msg_hash: 29 - 19f1b5b6d59c553d58bf926730e31014


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

Date: Sun, 13 Aug 2006 20:50:32 +0200
From: Marek Stepanek <mstep@t-online.de>
Subject: Beginner: read and print same file
Message-Id: <C1054118.2A106%mstep@t-online.de>



Hallo happy Perlers,


I have to bother you once again. I have a script with __DATA__ which will be
transformed later into a LaTeX Table. Just now I am stuck to insert these
DATA after a keyword "% begin", but I am not finding the solution.

Greetings from Munich,


marek


My LaTeX-Table "calc_hours_table02.tex" looks like follows:

\begin{longtable}[c]{| c | c | c | c | c | c | c | c |}

  \hline
%  \caption{table title}\\
  \multicolumn{8}{| c |}{\textbf{TITLE}} \\
  \hline
   & & & \multicolumn{5}{ c |}{\textbf{title}} \\
  \hline
  \textbf{Datum} & \textbf{Umsatz 7\%} & \textbf{Umsatz 16\%} &
\textbf{Beginn} & \textbf{Pause} & \textbf{Ende} & \textbf{Stunden} &
\textbf{Km-Gesamt} \\
  \hline
% begin <--- and here my script should insert the transformed data ...

  \hline
  \hline

\end



#!/usr/bin/perl

use strict;
use warnings;

####global variables########
my (@lines);
my ($date);
####END global variables####


#### Files #################
my $out_file = "calc_hours_table02.tex";
open OUT, "$out_file" or die "Error! $!\n;";
####END Files ##############


####Read in and work########
while (<DATA>)
  {
    chomp;
      next if (/^$/);

      if (/^(\w+, [\d\.]+)/)
        {
          $date = $1;
        }
        
    if (/^TOTAL/)
      {
        s/TOTAL/"$date"/e;
        push (@lines, $_);
      }
  }
####END Read in and work####

####Output##################
while (<OUT>)
  {
    if (/^(% begin)$/)
      {
         s/(% begin)/"$1\n" . join ("\n",@lines)/e; ###And here my problem!
#        print OUT "$1\n";
#        print OUT join ("\n",@lines);
#        print OUT "\n";
      }
  }
####END Output##############

######Data to read in#######

__DATA__

Son, 16.07.2006    37086.40    15445.00    808    19.50    3156.30
Mon, 17.07.2006    37667.00    15769.20    817    19.50    3621.00
TOTAL    580.60    324.20    9    0.00    464.70
                   
Mon, 17.07.2006    37667.00    15769.20    817    19.50    3621.00
Die, 18.07.2006    37936.50    15929.60    823    19.50    3857.80
TOTAL    269.50    160.40    6    0.00    236.80
                   
Die, 18.07.2006    37936.50    15929.60    823    19.50    3857.80
Mit, 19.07.2006    38147.50    16058.00    827    19.50    4042.80
TOTAL    211.00    128.40    4    0.00    185.00
                   
Mit, 19.07.2006    38147.50    16058.00    827    19.50    4042.80
Don, 20.07.2006    38371.80    16188.60    833    19.50    4247.40
TOTAL    224.30    130.60    6    0.00    204.60
                   
Don, 20.07.2006    38371.80    16188.60    833    19.50    4247.40
Fre, 21.07.2006    38607.70    16252.70    837    19.50    4359.20
TOTAL    235.90    64.10    4    0.00    111.80    55.00    166.80
                   
Fre, 21.07.2006    38607.70    16252.70    837    19.50    4359.20
Sam, 22.07.2006    38752.70    16351.60    844    20.50    4523.90
TOTAL    145.00    98.90    7    1.00    164.70
                   
Sam, 22.07.2006    38752.70    16351.60    844    20.50    4523.90
Son, 23.07.2006    38774.20    16351.60    844    20.50    4526.90
TOTAL    21.50    0.00    0    0.00    3.00
                   
Son, 23.07.2006    38774.20    16351.60    844    20.50    4526.90
Mon, 24.07.2006    39056.90    16499.80    849    20.50    4740.60
TOTAL    282.70    148.20    5    0.00    213.70
                   
Mon, 24.07.2006    39056.90    16499.80    849    20.50    4740.60
Die, 25.07.2006    39249.20    16574.60    853    20.50    4854.60
TOTAL    192.30    74.80    4    0.00    114.00
                   
Die, 25.07.2006    39249.20    16574.60    853    20.50    4854.60
Mit, 26.07.2006    39249.20    16574.60    853    20.50    4854.60
TOTAL    0.00    0.00    0    0.00    0.00    55.00    55.00
                   
Mit, 26.07.2006    39249.20    16574.60    853    20.50    4854.60
Don, 27.07.2006    39720.70    16762.90    864    21.50    5148.70
TOTAL    471.50    188.30    11    1.00    294.10
                   
Don, 27.07.2006    39720.70    16762.90    864    21.50    5148.70
Fre, 28.07.2006    39932.00    16847.60    872    22.00    5289.80
TOTAL    211.30    84.70    8    0.50    141.10
                   
Fre, 28.07.2006    39932.00    16847.60    872    22.00    5289.80
Sam, 29.07.2006    40002.60    16852.90    874    22.00    5307.00
TOTAL    70.60    5.30    2    0.00    17.20
                   
Sam, 29.07.2006    40002.60    16852.90    874    22.00    5307.00
Son, 30.07.2006    40002.60    16852.90    874    22.00    5307.00
TOTAL    0.00    0.00    0    0.00    0.00
                   
Son, 30.07.2006    40002.60    16852.90    874    22.00    5307.00
Mon, 31.07.2006    40224.40    16953.00    884    22.00    5485.40
TOTAL    221.80    100.10    10    0.00    178.40        



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

Date: 13 Aug 2006 12:15:18 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Beginner: read and print same file
Message-Id: <1155496518.384903.125200@74g2000cwt.googlegroups.com>


Marek Stepanek wrote:

>
> Just now I am stuck to insert these
> DATA after a keyword "% begin", but I am not finding the solution.
>


>
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>

Always good.

> ####global variables########
> my (@lines);
> my ($date);

Not sure why the parens are there, as they just add clutter.

>
>
> #### Files #################
> my $out_file = "calc_hours_table02.tex";
> open OUT, "$out_file" or die "Error! $!\n;";

You've opened OUT for reading, but yet you try and write to it later.
You're also needlessly quoting $out_file (see perldoc -q quote) and not
using the three-argument open:

open my $out, '>>', $outfile or die "Could not open $outfile for
writing: $!";

>
> ####Output##################
> while (<OUT>)
>   {
>     if (/^(% begin)$/)

Wasteful to capture in the pattern match just to throw it away. It's
also wasteful to test a substitution before doing it. You can use the
if condition to check whether the substitution happened and avoid
pattern matching first.

>       {
>          s/(% begin)/"$1\n" . join ("\n",@lines)/e; ###And here my problem!

Considering the print statements that follow this part, I have to think
you've missed a fundamental concept of reading and writing files. As
stated above, you didn't open the file in the right mode, but even if
you had, trying to read it and write to it at the same time cannot be
done by a simple read. If you can't read the file in and manipulate it
in memory, you might consider the Tie::File module.

You could have saved us some time by indicating the error messages you
got, rather than commenting them out and asking an unrelated question.

Matt



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

Date: 13 Aug 2006 12:20:26 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Beginner: read and print same file
Message-Id: <1155496826.228115.214370@p79g2000cwp.googlegroups.com>


Matt Garrish wrote:

> Marek Stepanek wrote:
>
> >
> > open OUT, "$out_file" or die "Error! $!\n;";
>
> You've opened OUT for reading, but yet you try and write to it later.
> You're also needlessly quoting $out_file (see perldoc -q quote)

By which I of course meant "perldoc -q quoting"...

Matt



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

Date: 13 Aug 2006 23:00:09 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Beginner: read and print same file
Message-Id: <ni4vd2dc60mmq1osbtj3vkln7qefrb93i4@4ax.com>

On Sun, 13 Aug 2006 20:50:32 +0200, Marek Stepanek <mstep@t-online.de>
wrote:

>I have to bother you once again. I have a script with __DATA__ which will be
>transformed later into a LaTeX Table. Just now I am stuck to insert these
>DATA after a keyword "% begin", but I am not finding the solution.

Since your actual question seems to have been already addressed... an
ad for a relatively unknown, but very nice, piece of software:
PerlTeX. Did you try it?


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Sun, 13 Aug 2006 23:34:00 +0200
From: Marek Stepanek <mstep@t-online.de>
Subject: Re: Beginner: read and print same file
Message-Id: <C1056768.2A110%mstep@t-online.de>

On 13.08.2006 23:00, in article ni4vd2dc60mmq1osbtj3vkln7qefrb93i4@4ax.com,
"Michele Dondi" <bik.mido@tiscalinet.it> wrote:

> On Sun, 13 Aug 2006 20:50:32 +0200, Marek Stepanek <mstep@t-online.de>
> wrote:
> 
>> I have to bother you once again. I have a script with __DATA__ which will be
>> transformed later into a LaTeX Table. Just now I am stuck to insert these
>> DATA after a keyword "% begin", but I am not finding the solution.
> 
> Since your actual question seems to have been already addressed... an
> ad for a relatively unknown, but very nice, piece of software:
> PerlTeX. Did you try it?
> 
> 
> Michele


Thank you Matt and Michele,


On 13.08.2006 21:15, in article
1155496518.384903.125200@74g2000cwt.googlegroups.com, "Matt Garrish"
<mgarrish@gmail.com> wrote:

> open my $out, '>>', $outfile or die "Could not open $outfile for
> writing: $!";

I am blushing, but I don't understand this one ! I will read once again
tomorrow:

perldoc -f open
perldoc perlopentut
perldoc Tie::File

Just for now I changed Matt's suggestion to:

my $out_file = "calc_hours_table02.tex";
# open my $out, '>>', $out_file or die "Could not open $out_file for
writing: $!"; # how I have to handle "my $out" later in my script?
open OUT, "+<$out_file" or die "Could not open $out_file for writing: $!";

which is inserting at the END of my out_file the @lines, instead of
inserting it AFTER % begin :

while (<OUT>)
  {
    if (/^% begin$/)
      {
         s/(% begin)/"$1\n" . join ("\n",@lines)/e;
      }
  }

thank you for your patience


marek (will be online only tomorrow evening)

ps: Michele, looking forward discovering PerlTeX tomorrow :-)



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

Date: 13 Aug 2006 15:23:56 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Beginner: read and print same file
Message-Id: <1155507836.380006.161070@i3g2000cwc.googlegroups.com>


Marek Stepanek wrote:

> Matt Garrish wrote:
> >
>
> > open my $out, '>>', $outfile or die "Could not open $outfile for
> > writing: $!";

[please don't intersperse your questions in quoted text]

> # how I have to handle "my $out" later in my script?
>

You can use a scalar to hold the filehandle:

print $out "I'm printing!";

There are a number of benfits to using a scalar, but rather than give
you an incomplete explanation I'll leave you to read up on it.

> open OUT, "+<$out_file" or die "Could not open $out_file for writing: $!";

> which is inserting at the END of my out_file the @lines, instead of
> inserting it AFTER % begin

If you want to do an in-place edit then you can use '+<', but not the
way you're trying to read/manipulate the file. You'd need to be using
syswrite/sysseek, and that's not for the faint of heart. Have a look at
perlopentut. It will explain the behaviour you're experiencing.

Again, though, the normal solutions are to slurp the file in,
manipulate it and write it back out or use Tie::File. 
 
Matt



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

Date: Sun, 13 Aug 2006 19:01:00 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Beginner: read and print same file
Message-Id: <x77j1cqlzn.fsf@mail.sysarch.com>

>>>>> "MG" == Matt Garrish <mgarrish@gmail.com> writes:

  MG> If you want to do an in-place edit then you can use '+<', but not the
  MG> way you're trying to read/manipulate the file. You'd need to be using
  MG> syswrite/sysseek, and that's not for the faint of heart. Have a look at
  MG> perlopentut. It will explain the behaviour you're experiencing.

  MG> Again, though, the normal solutions are to slurp the file in,
  MG> manipulate it and write it back out or use Tie::File. 

a future feature of File::Slurp will be the subs edit_file and
edit_file_lines. they will slurp in a file, call a code ref you pass in
with either the file or each line in $_, then write back out $_ to the
same file.

dunno when this will be done. it won't be much module code and most of
the work will be in option handling and writing tests. volunteers are
welcome to help! :)

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: 13 Aug 2006 16:23:19 -0700
From: "sal.x.lopez@gmail.com" <sal.x.lopez@gmail.com>
Subject: creating a datastructure from lists
Message-Id: <1155511399.542452.286020@i42g2000cwa.googlegroups.com>

I need to convert the following lists:

house,doors,knobs,style
house,doors,knobs,color
house,windows,length
house,windows,width

into a datastructure like this;

$ds = {
    'house' => {
        'doors' => {
            'knobs' => {
               'style' => "",
               'color' => '""
             }
        },
         'windows' => {
             'length' => "",
             'width' => ""
         }
    }
};

Does this require the use of recursive calls? Thanks in advance.



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

Date: 13 Aug 2006 16:46:02 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: creating a datastructure from lists
Message-Id: <1155512762.664591.223170@b28g2000cwb.googlegroups.com>


sal.x.lopez@gmail.com wrote:
> I need to convert the following lists:
>
> house,doors,knobs,style
> house,doors,knobs,color
> house,windows,length
> house,windows,width
>
> into a datastructure like this;
>
> $ds = {
>     'house' => {
>         'doors' => {
>             'knobs' => {
>                'style' => "",
>                'color' => '""
>              }
>         },
>          'windows' => {
>              'length' => "",
>              'width' => ""
>          }
>     }
> };
>
> Does this require the use of recursive calls?

No, it does not.  You can create loop that iterates over every element
in the current line, each time assigning the reference you're using to
the most recently created level of the structure.

Once you've made an attempt, if it doesn't work the way you want, post
here again, including a SHORT but COMPLETE script that demonstrates
your error, and someone can probably help you to fix it.

Paul Lalli



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

Date: 13 Aug 2006 20:29:46 -0000
From: Frog Admin <anon@comments.header>
Subject: Re: does it matter whether References headers are folded?
Message-Id: <FTYSPKSY38942.687337963@twistycreek.com>

Nomen Nescio <nobody@dizum.com> wrote:
>Right, but are the two formats absolutely equal or is one
>considerd a little better than the other?

For 2 of the groups to which you have crossposted this, the two forms
of header are fully equivalent.

In APAS they are far from equal. Some of the mail2news gateways do not
properly handle header lines exceeding about 120 or 180 characters:
the header may be truncated, or it may get broken into two pieces with
the second piece moved to become the first line in the body of the
message. You really don't want this.

So in APAS if your References header is going to exceed about 120
characters then it is advisable to distribute it over a few lines
each shorter than 120 characters with all but the first indented by a
few spaces, as you have been describing.

The frog software was written so that my gateway /never/ mangled long
headers, but some of the current gateways do exhibit this shortcoming.

F-A (retired)



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

Date: Mon, 14 Aug 2006 01:06:03 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Encrypt Windows Password
Message-Id: <pan.2006.08.13.23.06.03.717170@hjp.at>

On Wed, 09 Aug 2006 11:20:08 +0200, Peter.Kramer wrote:
> I want to write a perl module that encrypts a clear password to a windows 
> hash.
> I didnt find any algorithm that builds the hash expect copypwd.exe which 
> works, but is an external program that does not run as scheduled task.
> 
> "cleartextpassword " ->
> "52616e646f6d4956dc110786f80987daa99d164016ba7d72b24eb2a2931e0ff7"

Take a look at Crypt::SmbHash.

	hp

-- 
   _  | Peter J. Holzer    | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR       | > ist?
| |   | hjp@hjp.at         | Was sonst wäre der Sinn des Erfindens?
__/   | http://www.hjp.at/ |	-- P. Einstein u. V. Gringmuth in desd



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

Date: Mon, 14 Aug 2006 00:24:09 GMT
From: "a" <a@mail.com>
Subject: LWP::UserAgent question
Message-Id: <JoPDg.386093$Mn5.194189@pd7tw3no>

Hi
I would like to use LWP::UserAgent to login the web site and process the web
content. Then I should use $ua -> credentials($netloc, $realm, $uname,
$pass)
What is $netloc, $realm, $uname, and $pass?
Can someone post an example to demonstrate?
Thanks




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

Date: 13 Aug 2006 20:23:10 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: PerlDoc used in CPAN?--MULTIPOSTED
Message-Id: <8crud2ddqsnd70266340mccg5lv5g0oeum@4ax.com>

On Sun, 13 Aug 2006 11:26:17 -0400, Sherm Pendley
<sherm@Sherm-Pendleys-Computer.local> wrote:

>Get bent. I'll reply to whomever I please, and I'll do so in a manner that's
>far more constructive and helpful than your self-riteous whine-bot will
>*EVER* be.

I second that. I won't flame over one signaling multi-posts. But the
bot is annoying. Much more than the multi-post itself. If it doesn't
go away I'll plonk it straight on...


PS: I do understand the good intent, though.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 13 Aug 2006 16:55:22 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: PerlDoc used in CPAN?--MULTIPOSTED
Message-Id: <1155513322.444827.306340@h48g2000cwc.googlegroups.com>


usenet.cop@3955291010.com wrote:
> "Davy" <zhushenli@gmail.com> wrote:
> >> [ snip and ignore MULTIPOSTED message ]
>
> **********************************************************************
> **********   PLEASE  DO  NOT  RESPOND  TO  THIS  THREAD    ***********
> **********************************************************************
>
> This message has been multiposted as indicated by these message IDs:
>    <1155479132.418250.248360@p79g2000cwp.googlegroups.com>
>    <1155479132.418250.248360@p79g2000cwp.googlegroups.com>

Is this suppose to be irony?  The message IDs are identical. The OP DID
cross post, but this idiotic bot MULTIPOSTED.  And why the hell didn't
it detect its own multiposting?

> # Q-Who wrote this program? A-- I am not trying to keep my identity  #
> #   a big secret (it's easy enough to find out who I am, and group   #
> #   regulars probably recognize my rants). But I choose to run this  #
> #   scanner anonymously because some posters will be determined to   #
> #   take offense at this.

And by that you mean that everyone who's replied to your various
tirades about Multiposting has disagreed with you?  Everything from
"multiposting to p.b and c.l.p.m should be okay" to "instruct the OP,
yes, but burn the thread, no."?

> If they get mad at me, their anger may     #
> #   spill over into future postings that I participate in.

And how does not posting your address here prevent that, since, as you
said, all the "regulars" already know who you are?

Paul Lalli



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

Date: 13 Aug 2006 17:02:21 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: PerlDoc used in CPAN?--MULTIPOSTED
Message-Id: <1155513741.684610.298870@b28g2000cwb.googlegroups.com>


Sherm Pendley wrote:
> usenet.cop@3955291010.com writes:
>
> > "Davy" <zhushenli@gmail.com> wrote:
> >>> [ snip and ignore MULTIPOSTED message ]
> >
> > **********************************************************************
> > **********   PLEASE  DO  NOT  RESPOND  TO  THIS  THREAD    ***********
> > **********************************************************************
>
> Get bent. I'll reply to whomever I please, and I'll do so in a manner that's
> far more constructive and helpful than your self-riteous whine-bot will
> *EVER* be.
>

There is much that is annoying about the bot (in particular David's
intimation that he knows best where the thread should be answered). If
he were to remove all the junk and simply indicate where the other
posts have gone so that responses can be set accordingly it might not
be so bad, though.

Matt



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

Date: Mon, 14 Aug 2006 02:44:47 +0200
From: "Axel Dahmen" <NO_SPAM@NoOneKnows.invalid>
Subject: RegEx question: Exclude characters from group
Message-Id: <eboh9n$ggk$1@online.de>

Hi,

I'm searching for a regular expression to find every punctuation character
(UNICODE \p{P}) except for the quote character. I don't know how to do this.
Is there a NOT operator available?

TIA,
Axel Dahmen






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

Date: 13 Aug 2006 14:59:53 -0700
From: rallabs@adelphia.net
Subject: Re: system command won't let go
Message-Id: <1155506393.430212.21600@h48g2000cwc.googlegroups.com>


Brian McCauley wrote:
> rallabs@adelphia.net wrote:
>
> > I am having some difficulties with the 'system' command.
>
> > system "~/runsgood.exe<point.$newID";
>
> > and when I run the script here's what appears in a browser window:
> >
> > ENTER INPUT FILE NAME WITHOUT  .in EXTENSION
> >
> > Status: 302 Moved
> > Location: ~/cgi-bin/done.cgi
> >
> >
> > The prompt from runsgood.exe appears, just as it does when I run it
> > interactively.  The program does its job and the  output does appear in
> > my directory as it should, but it cannot get to the last line for some
> > reason.

> I have no idea what you meant by "it cannot get to the last line".

The last line of the script, which should take me to the page named
'done.cgi'
>
> >  Does anybody know how to stop this?
>
> If you are asking how you can redirect the output of the ~/runsgood.exe
> process then why don't you just use a shell redirect as you did to
> redirect the input?

I don't want to redirect the output of runsgood.  I merely want the
computer to take me to the next line, a redirect to 'done.cgi'.
>
> system "~/runsgood.exe <point.$newID >/dev/null";
>
> > I was hoping that I would
> > get the prompt to disappear because I had no header in the script,
>
> I have no idea what you meant by that.

When I put an & after the system command:

system "~/runsgood.exe<point.$newID" &
the new process runs in the background and the script continues on to
the 'last line' to execute the redirect command to 'done.cgi'.  The
book 'Learning Perl' at least the way I interpret it says that while
the 'system' function runs, Perl pauses and waits for it to finish and
then moves on, so it would seem that the original script I posted (with
no &) should do this: wait for 'runsgood.exe' to finish and then go to
'done.cgi'.  I don't understand it.  Thanks for the advice.
mike



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

Date: 13 Aug 2006 15:32:06 -0700
From: rallabs@adelphia.net
Subject: Re: system command won't let go
Message-Id: <1155508326.402783.194090@74g2000cwt.googlegroups.com>


Tad McClellan wrote:
> rallabs@adelphia.net <rallabs@adelphia.net> wrote:
>
>
> > system "~/runsgood.exe<point.$newID";
>
>
> > I was hoping that I would
> > get the prompt to disappear
>
>
> Then redirect the program's STDOUT:
>
>    system "~/runsgood.exe >/dev/null <point.$newID";
>
>
> --
>     Tad McClellan                          SGML consulting
>     tadmc@augustmail.com                   Perl programming
>     Fort Worth, Texas

Thanks very much.  This does stop the STDOUT output from 'runsgood.exe'
from appearing on the screen.  The script also then goes on to run the
last line of my script.  Running the process in the background also
accomplishes this.  I guess there really is "more than one way to do
it"  Don't ask me where the STDOUT goes to when I run 'system' in the
background.  Thanks again.



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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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


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