[30012] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1255 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Feb 4 14:09:47 2008

Date: Mon, 4 Feb 2008 11:09:07 -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           Mon, 4 Feb 2008     Volume: 11 Number: 1255

Today's topics:
    Re: "negative" regexp <bik.mido@tiscalinet.it>
    Re: "negative" regexp <bik.mido@tiscalinet.it>
    Re: circular buffering using substr() ? <azwemmer@gmail.com>
    Re: circular buffering using substr() ? <stoupa@practisoft.cz>
    Re: circular buffering using substr() ? <uri@stemsystems.com>
    Re: circular buffering using substr() ? <stoupa@practisoft.cz>
    Re: circular buffering using substr() ? <uri@stemsystems.com>
    Re: Magic for object constructor wanted <bik.mido@tiscalinet.it>
    Re: Need regexp to parse newsgroups <brian.d.foy@gmail.com>
        PDF API for password encryption? <asadon@xs4all.nl>
        Problem with Alphachannel with SDL::xxx blitting <romeyke@cbs.mpg.de>
    Re: To strip off a prefix in a variable.. <abigail@abigail.be>
    Re: To strip off a prefix in a variable.. <someone@example.com>
    Re: To strip off a prefix in a variable.. <stoupa@practisoft.cz>
    Re: Trying to properly use WWW::Mechanize <phillip.s.powell@gmail.com>
    Re: Trying to properly use WWW::Mechanize <hjp-usenet2@hjp.at>
    Re: Trying to properly use WWW::Mechanize <peter@makholm.net>
        Win32::Daemon Source Code <bol@adv.magwien.gv.at>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 04 Feb 2008 18:06:48 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: "negative" regexp
Message-Id: <9cheq3hj4rumom1qphjkpiqdu3o23ubkth@4ax.com>

On Fri, 1 Feb 2008 15:54:51 +0100, "Petr Vileta"
<stoupa@practisoft.cz> wrote:

>> In other words unless _YOU_ define a call-back that stores those
>> elements nothing will be stored. This way you can extract exactly
>> _what_ you want and store it in the _way_ you want it.
>
>Yes, sorry, I confound HTML::Parser and HTML::Tree

ITYM HTML::TreeBuilder. There's an HTML::Tree manpage (which I didn't
know) which servers as an overview to H::TB and other stuff.


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: Mon, 04 Feb 2008 18:13:39 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: "negative" regexp
Message-Id: <vlheq3pfvi13q64do18cl73j135apugug3@4ax.com>

On Fri, 1 Feb 2008 11:06:30 +0100, "Dr.Ruud" <rvtol+news@isolution.nl>
wrote:

>> Example for convert any basic html page to plain text.
>
>Use "|links -dump" as a filter. 

Or HTML::FormatText::WithLinks


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: Mon, 4 Feb 2008 05:29:13 -0800 (PST)
From: arz <azwemmer@gmail.com>
Subject: Re: circular buffering using substr() ?
Message-Id: <004562bb-b1cc-4030-a4dd-123b7f002c57@l16g2000hsh.googlegroups.com>

On 4 feb, 01:39, xhos...@gmail.com wrote:
> arz <azwem...@gmail.com> wrote:

> To do the Perl equivalent of moving the pointer without moving the data
> iself, you need to make what you want more explicit:
>
> substr($buffer, 0, $offset, "");
>
> At some point, this copies/moves the whole buffer to avoid leaking memory,
> but it only does so occasionally and so is much faster (when $buffer is
> big) than the assignment method, which does it every time.

Thanks, this is good to know, that's the use of substr() that I was
looking for. Looking further, it appears there's indeed no memory
problem here, it must be somewhere else. Thanks, now I can be
confident at least this is not the issue.

--arz


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

Date: Mon, 4 Feb 2008 15:23:46 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: circular buffering using substr() ?
Message-Id: <fo77oo$2nhv$2@ns.felk.cvut.cz>

arz wrote:
> On 4 feb, 01:39, xhos...@gmail.com wrote:
>> arz <azwem...@gmail.com> wrote:
> 
>> To do the Perl equivalent of moving the pointer without moving the
>> data iself, you need to make what you want more explicit:
>> 
>> substr($buffer, 0, $offset, "");
>> 
>> At some point, this copies/moves the whole buffer to avoid leaking
>> memory, but it only does so occasionally and so is much faster (when
>> $buffer is big) than the assignment method, which does it every time.
> 
> Thanks, this is good to know, that's the use of substr() that I was
> looking for. Looking further, it appears there's indeed no memory
> problem here, it must be somewhere else. Thanks, now I can be
> confident at least this is not the issue.
> 
Maybe will be better to use array. When you get data then you
    push @buffer, $data;
and when you want to send data then you
    print OUT shift @buffer;
or you can send whole buffer by
    print OUT @buffer;
or clearer
    print OUT join('', @buffer);

This is true circular buffer with unlimited size ;-)
-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.) 

Please reply to <petr AT practisoft DOT cz>



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

Date: Mon, 04 Feb 2008 15:45:15 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: circular buffering using substr() ?
Message-Id: <x7ir14914k.fsf@mail.sysarch.com>

>>>>> "PV" == Petr Vileta <stoupa@practisoft.cz> writes:

  PV> arz wrote:
  >> On 4 feb, 01:39, xhos...@gmail.com wrote:
  >>> arz <azwem...@gmail.com> wrote:
  >> 
  >>> To do the Perl equivalent of moving the pointer without moving the
  >>> data iself, you need to make what you want more explicit:
  >>> substr($buffer, 0, $offset, "");
  >>> At some point, this copies/moves the whole buffer to avoid leaking
  >>> memory, but it only does so occasionally and so is much faster (when
  >>> $buffer is big) than the assignment method, which does it every time.
  >> Thanks, this is good to know, that's the use of substr() that I was
  >> looking for. Looking further, it appears there's indeed no memory
  >> problem here, it must be somewhere else. Thanks, now I can be
  >> confident at least this is not the issue.
  >> 
  PV> Maybe will be better to use array. When you get data then you
  PV>     push @buffer, $data;
  PV> and when you want to send data then you
  PV>     print OUT shift @buffer;
  PV> or you can send whole buffer by
  PV>     print OUT @buffer;
  PV> or clearer
  PV>     print OUT join('', @buffer);

  PV> This is true circular buffer with unlimited size ;-)

and a string isn't unlimited in size? 

your design has a major flaw in it. what if the write of the first array
element is only partial (remember, it is non-blocking I/O)? then you
have to truncate that part to remove the section that was written. this
means you have to implement the same substr logic as he has for that
element. the opposite is true too. what if an element is fully written,
do you loop and write the next element (and so on)? this means even more
logic. so your array idea has to have at least the same code as the
substr idea plus much more to handle the array elements. all for no
actual gain over a single buffer string.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Architecture, Development, Training, Support, Code Review  ------
-----------  Search or Offer Perl Jobs  ----- http://jobs.perl.org  ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Mon, 4 Feb 2008 18:53:42 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: circular buffering using substr() ?
Message-Id: <fo7jfg$2u0h$1@ns.felk.cvut.cz>

Uri Guttman wrote:
>>>>>> "PV" == Petr Vileta <stoupa@practisoft.cz> writes:
>
>> Maybe will be better to use array. When you get data then you
>>     push @buffer, $data;
>> and when you want to send data then you
>>     print OUT shift @buffer;
>> or you can send whole buffer by
>>     print OUT @buffer;
>> or clearer
>>     print OUT join('', @buffer);
>
>> This is true circular buffer with unlimited size ;-)
>
> and a string isn't unlimited in size?
>
> your design has a major flaw in it. what if the write of the first
> array element is only partial (remember, it is non-blocking I/O)?
> then you
> have to truncate that part to remove the section that was written.

OK, you can accumulate non-blocking I/O into string variable until you will 
get "\n" or other mark meaning data is complete and push this string when 
completed.

> this means you have to implement the same substr logic as he has for
> that element. the opposite is true too. what if an element is fully
> written, do you loop and write the next element (and so on)?
No, push increase array size (add new element at end) and shift decrease array 
size (remove 1st element).

Example: (printed values are preceed with "/perl>")

push @buffer, "abc\n";
print @buffer;

/perl>
abc

push @buffer, "def\n";
print @buffer;

/perl>
abc
def

shift @buffer;
print @buffer;

/perl>
def

-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)

Please reply to <petr AT practisoft DOT cz>



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

Date: Mon, 04 Feb 2008 18:38:39 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: circular buffering using substr() ?
Message-Id: <x7odaw7ej5.fsf@mail.sysarch.com>

>>>>> "PV" == Petr Vileta <stoupa@practisoft.cz> writes:

  PV> Uri Guttman wrote:
  >>>>>>> "PV" == Petr Vileta <stoupa@practisoft.cz> writes:
  >> 
  >>> Maybe will be better to use array. When you get data then you
  >>> push @buffer, $data;
  >>> and when you want to send data then you
  >>> print OUT shift @buffer;
  >>> or you can send whole buffer by
  >>> print OUT @buffer;
  >>> or clearer
  >>> print OUT join('', @buffer);
  >> 
  >>> This is true circular buffer with unlimited size ;-)
  >> 
  >> and a string isn't unlimited in size?
  >> 
  >> your design has a major flaw in it. what if the write of the first
  >> array element is only partial (remember, it is non-blocking I/O)?
  >> then you
  >> have to truncate that part to remove the section that was written.

  PV> OK, you can accumulate non-blocking I/O into string variable until you
  PV> will get "\n" or other mark meaning data is complete and push this
  PV> string when completed.

that still won't work unless your protocol is line oriented. and with
differing stream speeds (the OP's real problem) that will not likely be
workable. 

  >> this means you have to implement the same substr logic as he has for
  >> that element. the opposite is true too. what if an element is fully
  >> written, do you loop and write the next element (and so on)?
  PV> No, push increase array size (add new element at end) and shift
  PV> decrease array size (remove 1st element).

no, i know what you mean. please don't tell me about how to do
buffering. the array is MORE complex and slower than a single string
buffer. period. as i said you need all the string buffer logic and also
the array buffer logic.

you don't understand non-blocking stream I/O. it is not line oriented
and you can just push/pop single bits of i/o at will. you have to
maintain your buffers with finer granularity than lines.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Architecture, Development, Training, Support, Code Review  ------
-----------  Search or Offer Perl Jobs  ----- http://jobs.perl.org  ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Mon, 04 Feb 2008 18:28:27 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Magic for object constructor wanted
Message-Id: <ubieq3dcbdpit69ff5pktse3dg6vm9m9is@4ax.com>

On Fri, 1 Feb 2008 11:29:11 +0100, "Dr.Ruud" <rvtol+news@isolution.nl>
wrote:

>> A Dude normally does not
>> get a name once he gets friends, he has a name, so the constructor
>> should set the name.
>
>Best let the constructor only construct, and make a separate initiator
>to initialize values.

This is a technical detail. I like to leave constructors as simple as
possibile and I let them *call* an initializator to actually
initialize values. But the comment you're replying to does make
perfectly sense, in terms of UI. Said this, if the OP has a set of
dudes, he may like to implement a Dudes class to which he can add
dudes:

  my $dudes = Dudes->new;
  $dudes->add(joe => qw/ann tom/);
  $dudes->add(jane => qw/ann/);

and let add() do the job. (Including creating suitable Dude objects
for friends if they do not exist.)


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: Mon, 04 Feb 2008 11:22:57 -0600
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: Need regexp to parse newsgroups
Message-Id: <040220081122571692%brian.d.foy@gmail.com>

In article <slrnfqdhg8.v9.abigail@alexandra.abigail.be>, Abigail
<abigail@abigail.be> wrote:

> M.L. (me@privacy.invalid) wrote on VCCLXX September MCMXCIII in

> {}  In short, I want the following newsgroup examples to pass the Xref 
> {}  filter so they can be dropped:
> {}  general.soc
> {}  soc.general
> {}  soc.general.sci
> {}  francom.chatting.generale
> {}  
> {}  I want the following two to fail so they will be retained:
> {}  chi.general
> {}  microsoft.public.windowsxp.general
> {}  
> {}  Any assistance would be greatly appreciated. Thanks in advance. 

> Untested:

> /(?!\Qchi.general\E|\Qmicrosoft.public.windowsxp.general\E)(?<!\S)\S*general\S
> */
> 

>   @groups = grep {$_ eq 'chi.general'                        ||
>                   $_ eq 'microsoft.public.windowsxp.general' ||
>                  !/general/} @groups;


As Abigail does, forget about the exceptions in the regex. Pass those
through first then look at the rest. Note that I added \b to regex so
you don't filter out alt.generalissimo.franco. :)

#!/usr/bin/perl

my $string = "prodigy.net general.soc:449517 chi.general:641065
soc.general.sci:329682 francom.chatting.generale:152591";

%Exceptions = map { $_, 1 } qw( chi.general
microsoft.public.windowsxp.general );

print
join " ",
grep { 
   my( $group, $number ) = split /:/;
   exists $Exceptions{$group} or $group !~ /\bgenerale?\b/ 
   }
   split /\s+/, $string;


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

Date: Mon, 4 Feb 2008 06:57:48 -0800 (PST)
From: AlainS <asadon@xs4all.nl>
Subject: PDF API for password encryption?
Message-Id: <d0c9e175-803e-4342-9b1d-38d477650f67@j78g2000hsd.googlegroups.com>

Selling an e-book in pdf-format, I want to secure the pdf with a
password encryption. In Adobe you can do that by hand through "Secure-
Password Encrypt", but I want to do this automatically by writing a
perl-script. I discovered a PDF::API2 module, but I can't discover if
that module also offers a password encrypt-functionality.

Is there anybody having experience with this module or having an
alternative for PDF::API2 that can do the job?

Thanks a lot!

Alain


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

Date: Mon, 4 Feb 2008 11:52:13 +0100
From: Andreas Romeyke <romeyke@cbs.mpg.de>
Subject: Problem with Alphachannel with SDL::xxx blitting
Message-Id: <20080204115213.4f7fc0b1@julia.cbs.mpg.de>

Hello,

In my script I want to blit PNG-images on the application screen via
the SDL-modules.

The problem is, that the alpha-channel of my PNG-images will be ignored
and drawed as black. My initilization looks like:

	my $sdl_flags = SDL_ANYFORMAT | SDL_HWSURFACE | SDL_DOUBLEBUF |
	SDL_HWACCEL | SDL_ASYNCBLIT;

	# define Application Window/Screen
	my $app = SDL::App->new(
		-title=> "Moving Balls",
		-depth => 32, # color depth
		-width => 800,
		-height => 600,
		-resizeable => 1,
		-doublebuffer=>1,
		-flags =>  $sdl_flags,
	);

But the problem occurs also if I leave the flags and color depth empty.

I used the article on Ars Technica written by Andy Bakun
(http://arstechnica.com/guides/tweaks/games-perl.ars) and another onbe
written by Michael Schilli
(http://perlmeister.com/snapshots/200710/index.html) as base
documentation, because the core documentaion shipped with the
SDL-Module is, erm, unusable.

The blitting method of my sprite-objects looks like:

	sub _draw {
		my $self=shift;
		my $app=shift;
		my $image=shift;
		my $pos = $self->get_position();
		my $x = $pos->[0];
		my $y = $pos->[1];
		my $rect=$self->{rect};
		my $old_rect = SDL::Rect->new(
			-height => $rect->height,
			-width => $rect->width,
			-x => $rect->x,
			-y => $rect->y,
		);
		$rect->x($pos->[0]);
		$rect->y($pos->[1]);
		$self->{rect}=$rect;
		$app->fill($old_rect,
			$bg_color);
		$image->blit(0,$app,$rect);
		$app->update($old_rect, $rect);
	}

and the images are initialized in sprite-objects constructor by calling:

	sub _init_image {
		my $self=shift;
		my $img = shift;
		my $image =  SDL::Surface->new(
			-name=> $img,
			-depth => 32,
		);
		return $image;
	}

The blitting works as expected, but the pixels of transparency on
given PNG are drawed black. 

	$> file *.png

reports that:

flower.png: PNG image data, 48 x 48, 8-bit/color RGBA, non-interlaced
logo.png:   PNG image data, 28 x 22, 8-bit/color RGBA, non-interlaced
smiley.png: PNG image data, 48 x 48, 8-bit/color RGBA, non-interlaced
thing.png:  PNG image data, 48 x 48, 8-bit/color RGBA, non-interlaced

Please could you help me where I am wrong and what kind of
SDL-needs I have not used?

I am working under Debian Etch with SDL version:

libsdl-perl: 1.20.3dfsg-1

perl -e 'use SDL; print $SDL::VERSION;' reports "1.20.3".

Any hints?

Bye Andreas









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

Date: 04 Feb 2008 10:52:12 GMT
From: Abigail <abigail@abigail.be>
Subject: Re: To strip off a prefix in a variable..
Message-Id: <slrnfqdris.v1o.abigail@alexandra.abigail.be>

                                                     _
clearguy02@yahoo.com (clearguy02@yahoo.com) wrote on VCCLXX September
MCMXCIII in <URL:news:b77e9b2f-1f46-40ca-8c6f-6f4ace4ea39d@i29g2000prf.googlegroups.com>:
}}  Hi all,
}}  
}}  I have the following variable:
}}  
}}  $a = "xxx_active_jsmith";
}}  
}}  Now I want to strip ohf the prefix, xxx_active_ and want to store only
}}  the id, jsmith into the variable $b. That means, it should be $b =
}}  "jsmith";
}}  
}}  How can I do that?


Here are a couple of untested solutions which will work for your example:


    $b = "jsmith";   # Probably the simplest solution. Works for 100% of
                     # the supplied cases.

%%

    $b = substr $a, -6;

%%

    $b = $a; $b =~ s/.// until $b =~ /^j/;

%%

    $b = $a; $b =~ s/.*?_// for 4, 7;

%%

    $b = (split $a => '_') [-1];

%%

    $b = (split $a => '(jsmith)') [-1];

%%

    $b .= chop $a until $b =~ /j/; $b = reverse $b;

%%

    $b = reverse $a; chop $b while $b =~ /_/; $b = reverse $b;



Abigail
-- 
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$==-2449231+gm_julian_day+time);do{until($=<$#r){$_.=$r[$#r];$=-=$#r}for(;
!$r[--$#r];){}}while$=;$,="\x20";print+$_=>September=>MCMXCIII=>=>=>=>=>=>=>=>'


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

Date: Mon, 04 Feb 2008 11:35:26 GMT
From: "John W. Krahn" <someone@example.com>
Subject: Re: To strip off a prefix in a variable..
Message-Id: <2MCpj.8416$w57.4591@edtnps90>

clearguy02@yahoo.com wrote:
> 
> I have the following variable:
> 
> $a = "xxx_active_jsmith";
> 
> Now I want to strip ohf the prefix, xxx_active_ and want to store only
> the id, jsmith into the variable $b. That means, it should be $b =
> "jsmith";
> 
> How can I do that?

( $b ) = $a =~ /([^_]+)\z/;


( $b = $a ) =~ s/.*_//;



John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: Mon, 4 Feb 2008 15:29:16 +0100
From: "Petr Vileta" <stoupa@practisoft.cz>
Subject: Re: To strip off a prefix in a variable..
Message-Id: <fo77op$2nhv$3@ns.felk.cvut.cz>

clearguy02@yahoo.com wrote:
> Hi all,
> 
> I have the following variable:
> 
> $a = "xxx_active_jsmith";
> 
> Now I want to strip ohf the prefix, xxx_active_ and want to store only
> the id, jsmith into the variable $b. That means, it should be $b =
> "jsmith";
> 
> How can I do that?
> 

($b = $a) =~ s/^.*_(.+)/$1/;

-- 
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.) 

Please reply to <petr AT practisoft DOT cz>



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

Date: Mon, 4 Feb 2008 05:57:07 -0800 (PST)
From: Phil Powell <phillip.s.powell@gmail.com>
Subject: Re: Trying to properly use WWW::Mechanize
Message-Id: <ef14621c-e40c-4f7f-b501-e98281885d99@d4g2000prg.googlegroups.com>

On Feb 1, 9:09=A0pm, Tad J McClellan <ta...@seesig.invalid> wrote:
> Phil Powell <phillip.s.pow...@gmail.com> wrote:
> > my $mech =3D WWW::Mechanize->new();
> > $mech->get('https://www.example.com');
> > my $content =3D $mech->content;
>
> > if ($content ne "") {
> > =A0open(HTML, ">$file");
> > =A0print HTML $content;
> > =A0close(HTML);
> > =A0print "file \"$file\" created\n\n";
> > } else {
> > =A0print "unable to create file \"$file\"";
> > }
>
> You have a logic error that is independant of the choice of
> programming language.
>
> If you are able to get the resource, but are unable to create
> the file, your program will output:
>
> =A0 =A0file "blah/blah.index.html" created
>
> If you are not able to get the resource, your program will output:
>
> =A0 =A0unable to create file "blah/blah.index.html"
>
> You should always, yes *always*, check the return value from open():
>
> =A0 =A0 open(HTML, ">$file") or die "could not open '$file' $!";

I haven't coded in Perl in several years so I'll forget that step,
which isn't often done in my native language of PHP.

>
> --
> Tad McClellan
> email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"



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

Date: Mon, 4 Feb 2008 18:15:44 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: Trying to properly use WWW::Mechanize
Message-Id: <slrnfqei21.4u8.hjp-usenet2@hrunkner.hjp.at>

On 2008-02-04 13:57, Phil Powell <phillip.s.powell@gmail.com> wrote:
> On Feb 1, 9:09 pm, Tad J McClellan <ta...@seesig.invalid> wrote:
>> You should always, yes *always*, check the return value from open():
>>
>>     open(HTML, ">$file") or die "could not open '$file' $!";
>
> I haven't coded in Perl in several years so I'll forget that step,
> which isn't often done in my native language of PHP.

Does PHP open throw an exception on error? If not you should get into
the habit of explicitely checking for errors in PHP, too.

(There is a perl module which causes the usual I/O functions to die() on
error, but I forgot its name)

	hp


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

Date: Mon, 04 Feb 2008 17:25:45 +0000
From: Peter Makholm <peter@makholm.net>
Subject: Re: Trying to properly use WWW::Mechanize
Message-Id: <87tzkoiqg6.fsf@hacking.dk>

"Peter J. Holzer" <hjp-usenet2@hjp.at> writes:

> (There is a perl module which causes the usual I/O functions to die() on
> error, but I forgot its name)

use Fatal qw(open close);

//Makholm


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

Date: Mon, 4 Feb 2008 10:51:56 +0100
From: "Ferry Bolhar" <bol@adv.magwien.gv.at>
Subject: Win32::Daemon Source Code
Message-Id: <1202118718.809584@proxy.dienste.wien.at>

Hi,

I'm looking for the source code of Win32::Daemon (especially for
DAEMON.DLL). I didn't find it on the authors page
(http://www.roth.net). Can someone tell me where I could find it?

MTIA & kind greetings

Ferry

-- 
Ing Ferry Bolhar
Magistrat der Stadt Wien - MA 14
A-1010 Wien
E-Mail: ferdinand.bolhar-nordenkampf@wien.gv.at


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

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 V11 Issue 1255
***************************************


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