[25945] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8164 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 11 00:05:15 2005

Date: Fri, 10 Jun 2005 21:05:03 -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           Fri, 10 Jun 2005     Volume: 10 Number: 8164

Today's topics:
    Re: chown recursively <timodonovan@localhost.com>
    Re: how to format a $htmlpage without form feed <noreply@gunnar.cc>
        setting perlio layers (e.g., utf8) on "magic" ARGV file <dave@nospam.com>
    Re: setting perlio layers (e.g., utf8) on "magic" ARGV  <dave@nospam.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 11 Jun 2005 01:05:41 +0000 (UTC)
From: Tim O'Donovan <timodonovan@localhost.com>
Subject: Re: chown recursively
Message-Id: <d8ddd5$aqr$1@nwrdmz01.dmz.ncs.ea.ibs-infra.bt.com>

Abigail wrote:
> Indeed. I'd write that as:
> 
>     @links = `find $path -lname '/home/$username/*'`;

I have been getting rather confused trying to find a way to achieve this 
using the -l file test as a few people have suggested. From the perldoc 
it describes this as finding the symbolic links to a file that *don't* 
resolve; I need to find links that *do*. I will probably now use your 
suggestion to achieve this due to my frivolous attempts at using !-l !


Tim


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

Date: Sat, 11 Jun 2005 03:05:28 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: how to format a $htmlpage without form feed
Message-Id: <3gus09Feas97U1@individual.net>

Oliver Bleckmann wrote:
> it would be nice - just for reading - to break a line after every
> closed tag - that means after a ">".

<snip>

> use LWP::Simple;
>       $URL="http://de.finance.yahoo.com/q/cq?s=710000&m=a";
>       $inh = get($URL);

     $inh =~ s/>/>\n/g;

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Fri, 10 Jun 2005 21:18:27 -0400
From: Dave <dave@nospam.com>
Subject: setting perlio layers (e.g., utf8) on "magic" ARGV file handle
Message-Id: <y_idnRIVuchwpjffRVn-1A@rcn.net>

I was able to find a few references to similar dilemmas by searching
Google Groups, but none of them fully satisfied my question.

When processing one or more files that have been passed to one's Perl
program from the command line, how does one achieve an effect equivalent
to calling "binmode(FH, ":layer")"?  Using "binmode(ARGV)" does not seem
to work for this purpose, because binmode() cannot be called before the
file is open.

As a practical matter, I can use the "C" option on the command line to
workaround this limitation in my present situation, but I would like to
know how to manipulate the layers on the files in @ARGV from within my
program.  In addition, the "C" option only controls some of Perl's
Unicode behavior, so it will not always be a viable workaround,
depending on what I'm doing.

I realize that I can of course explicitly open the files myself, but I
can't help but to think that there must exist a more elegant solution
than that.

Dave


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

Date: Fri, 10 Jun 2005 22:17:28 -0400
From: Dave <dave@nospam.com>
Subject: Re: setting perlio layers (e.g., utf8) on "magic" ARGV file handle
Message-Id: <jfKdnUPvnrFe1DffRVn-jA@rcn.net>

It seems that the "open" pragma works for this.  I hadn't thought of
that because I've never used it.

However, this raises yet *another* question.

From "perldoc perlopen":

    The "open" pragma serves as one of the interfaces
    to declare default "layers" (also known as
    "disciplines") for all I/O. Any two-argument open
    (), readpipe() (aka qx//) and similar operators
    found within the lexical scope of this pragma
    will use the declared defaults. Three-argument
    opens are not affected by this pragma since there
    you (can) explicitly specify the layers and are
    supposed to know what you are doing.

But further down, it reads:

    When open() is given an explicit list of layers
    they are appended to the list declared using this
    pragma.

So which is it?  If you e.g., "use open IO => ':foo'", and then open a
file with the three-argument notation, e.g., "open(FH, '>:bar',
'myfile')", is the layer "bar" appended to "foo" or not?  It seems that
the perlopen documentation contradicts itself, but perhaps I am
misinterpreting something.

Also, from my initial experimentation, it seems that you can't stack
multiple layers in the way that you can with "open"; e.g., open(FH,
':foo:bar', 'myfile').  I don't recall any mention of that in the
documentation.

Dave


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

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


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