[30656] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1901 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 6 03:09:44 2008

Date: Mon, 6 Oct 2008 00:09:09 -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           Mon, 6 Oct 2008     Volume: 11 Number: 1901

Today's topics:
        Best free casino games wbdismalgoldstein@gmail.com
        Buy Cialis online uqparimutuelmorse@googlemail.com
    Re: Download files script. <sbryce@scottbryce.com>
    Re: Download files script. <sbryce@scottbryce.com>
    Re: is Win32::GUI thread safe? <remay.uk@googlemail.com>
        new CPAN modules on Mon Oct  6 2008 (Randal Schwartz)
        Places that are hiring in my area woodsonturtletw@gmail.com
    Re: Problems flushing my buffer! (perl) <joe@inwap.com>
    Re: Problems flushing my buffer! (perl) <flowerysong00@yahoo.com>
    Re: simple CGI and ASP <bwalton@nospam.invalid>
        sysread <dontmewithme@got.it>
    Re: sysread <tadmc@seesig.invalid>
    Re: sysread <bwalton@nospam.invalid>
    Re: sysread xhoster@gmail.com
    Re: What does m@ stand for in the following regular exp (fidokomik\)
    Re: What does m@ stand for in the following regular exp <michael1cat@yahoo.com>
        What's the difference between *ERROR and \*ERROR in the <cdalten@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 5 Oct 2008 17:04:36 -0700 (PDT)
From: wbdismalgoldstein@gmail.com
Subject: Best free casino games
Message-Id: <42586d46-1e91-4259-93ba-df1e641bae97@j68g2000hsf.googlegroups.com>

 .
 .
 .
Welcome to the Golden Palace online casino!
We are one of the most trusted internet casinos online today, making
winners since 1997!
We offer a huge selection of free online casino games to download and
play for free or for real money.
Visit our website -
************************************
http://med247.us/?p=adventure+palace+online+casino
************************************
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 ogo slots cheat pgo slots cheat poo slots cheat pog slots cheat pogo
lots cheat pogo sots cheat pogo slts cheat pogo slos cheat pogo slot
cheat pogo slots heat pogo slots ceat pogo slots chat pogo slots chet
pogo slots chea ppogo slots cheat poogo slots cheat poggo slots cheat
pogoo slots cheat pogo sslots cheat pogo sllots cheat pogo sloots
cheat pogo slotts cheat pogo slotss cheat pogo slots ccheat pogo slots
chheat pogo slots cheeat pogo slots cheaat pogo slots cheatt opgo
slots cheat pgoo slots cheat poog slots cheat pog oslots cheat pogo
lsots cheat pogo solts cheat pogo sltos cheat pogo slost cheat pogo
slot scheat pogo slots hceat pogo slots cehat pogo slots chaet pogo
slots cheta pogoslots cheat pogo slotscheat oogo slots cheat 0ogo
slots cheat logo slots cheat pigo slots cheat p9go slots cheat p0go
slots cheat ppgo slots cheat plgo slots cheat pkgo slots cheat pofo
slots cheat poto slots cheat poyo slots cheat poho slots cheat pobo
slots cheat povo slots cheat pogi slots cheat pog9 slots cheat pog0
slots cheat pogp slots cheat pogl slots cheat pogk slots cheat pogo
alots cheat pogo wlots cheat pogo elots cheat pogo dlots cheat pogo
xlots cheat pogo zlots cheat pogo skots cheat pogo soots cheat pogo
spots cheat pogo slits cheat pogo sl9ts cheat pogo sl0ts cheat pogo
slpts cheat pogo sllts cheat pogo slkts cheat pogo slors cheat pogo
slo5s cheat pogo slo6s cheat pogo sloys cheat pogo slohs cheat pogo
slogs cheat pogo slofs cheat pogo slota cheat pogo slotw cheat pogo
slote cheat pogo slotd cheat pogo slotx cheat pogo slotz cheat pogo
slots xheat pogo slots dheat pogo slots fheat pogo slots vheat pogo
slots cgeat pogo slots cyeat pogo slots cueat pogo slots cjeat pogo
slots cneat pogo slots cbeat pogo slots chwat pogo slots ch3at pogo
slots ch4at pogo slots chrat pogo slots chfat pogo slots chdat pogo
slots chsat pogo slots cheqt pogo slots chewt pogo slots chest pogo
slots chext pogo slots chezt pogo slots chear pogo slots chea5 pogo
slots chea6 pogo slots cheay pogo slots cheah pogo slots cheag pogo
slots cheaf


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

Date: Sun, 5 Oct 2008 15:25:39 -0700 (PDT)
From: uqparimutuelmorse@googlemail.com
Subject: Buy Cialis online
Message-Id: <d709a315-9aeb-48eb-9807-1b05725e15ce@h60g2000hsg.googlegroups.com>

buy cheap cialis online
 .
 .
 .
Enough to seek Cialis! You've already found the best site where
you can purchase Cialis for lowest price!
To order Cialis without prescription visit link below!
************************************
http://med247.us/?p=cialis
************************************
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 uy cheap cialis online by cheap cialis online bu cheap cialis online
buy heap cialis online buy ceap cialis online buy chap cialis online
buy chep cialis online buy chea cialis online buy cheap ialis online
buy cheap calis online buy cheap cilis online buy cheap ciais online
buy cheap cials online buy cheap ciali online buy cheap cialis nline
buy cheap cialis oline buy cheap cialis onine buy cheap cialis onlne
buy cheap cialis onlie buy cheap cialis onlin bbuy cheap cialis online
buuy cheap cialis online buyy cheap cialis online buy ccheap cialis
online buy chheap cialis online buy cheeap cialis online buy cheaap
cialis online buy cheapp cialis online buy cheap ccialis online buy
cheap ciialis online buy cheap ciaalis online buy cheap ciallis online
buy cheap cialiis online buy cheap cialiss online buy cheap cialis
oonline buy cheap cialis onnline buy cheap cialis onlline buy cheap
cialis onliine buy cheap cialis onlinne buy cheap cialis onlinee uby
cheap cialis online byu cheap cialis online buy cheap cialis online
buy hceap cialis online buy cehap cialis online buy chaep cialis
online buy chepa cialis online buy cheap cialis online buy cheap
icalis online buy cheap cailis online buy cheap cilais online buy
cheap ciails online buy cheap cialsi online buy cheap cialis online
buy cheap cialis noline buy cheap cialis olnine buy cheap cialis
onilne buy cheap cialis onlnie buy cheap cialis onlien buy cheap
cialis online buy cheap cialis online buy cheap cialis online buy
cheap cialis online buy cheap cialis online buy cheap cialis online
buy cheap cialis online buy cheap cialis online buy cheap cialis
online buy cheap cialis online buy cheap cialis online buy cheap
cialis online buy cheap cialis online buy cheap cialis online buy
cheap cialis online buy cheap cialis online buy cheap cialis online
buy cheap cialis online buy cheap cialis online buy cheap cialis
online buy cheap cialis online


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

Date: Sun, 05 Oct 2008 07:24:44 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Download files script.
Message-Id: <wIKdnW4NZLi6XXXVnZ2dnUVZ_qXinZ2d@comcast.com>

mathaios wrote:
> On Sep 30, 2:46 am, Rich Grise <r...@example.net> wrote:
>> On Sun, 28 Sep 2008 03:29:26 -0700, mathaios wrote:
>>> Hi. I want to install a script in my website  for the visitors to
>>> be able to download files.
>> Why not just link to it, and let them click "save to disk"?
>> 
>> Cheers! Rich
> 
> How do i do that?

That is a question for an HTML newsgroup.

Seriously, if you don't know how to create a link to a file, you don't
have any hope of installing a script.


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

Date: Sun, 05 Oct 2008 07:25:43 -0600
From: Scott Bryce <sbryce@scottbryce.com>
Subject: Re: Download files script.
Message-Id: <wIKdnWkNZLj_XXXVnZ2dnUVZ_qXinZ2d@comcast.com>

mathaios wrote:
> Hi. I want to install a script in my website  for the visitors to be
> able to download files. Is there anyone who can replace the variables
> needed to be changed in the script  below for base downloads folder,
> downloads log file name, allowed file types with highlighted example
> text?


The answer now isn't any different than it was the last time you asked.


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

Date: Sun, 5 Oct 2008 07:36:59 -0700 (PDT)
From: Robert May <remay.uk@googlemail.com>
Subject: Re: is Win32::GUI thread safe?
Message-Id: <eb60f44f-a049-4bd1-b0e9-087ae4b71097@t54g2000hsg.googlegroups.com>

On Oct 3, 7:34=A0pm, "Tom F." <starbuck42+newsgr...@gmail.com> wrote:
> zentara wrote:
> > On Thu, 02 Oct 2008 23:36:16 -0400, "Tom F."
> > <starbuck42+newsgr...@gmail.com> wrote:
> >> I've tested all the net stuff without the GUI (but using threads) and =
it
> >> works fine. So, that leads me to think Win32::GUI is not thread safe,

Correct.

> >> and the mere presence of any of the different GUI objects is causing m=
yhttp://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/36c70=
9fb2699584a#
> >> problem.

Correct.  Each object gets cloned in the thread, and when the thread
terminates the DESTORY() method is called for each object during perl
global clean-up.  For many of the objects calling the DESTROY() method
from anything other than the thread that created the object is a no-
no.

> >> Google has only revealed very old information and other dead ends. Hel=
p!

Take a look at Win32::GUI::ThreadUtils here:
http://www.robmay.me.uk/win32gui (towards the bottom of the page.

> > I would bet that you can solve the problem by :
> > 1. Create the thread first in the program, before any gui code
> > is invoked. =A0For instance, you cannot reliably launch
> > threads from a gui callback. Threads get a copy of the
> > parent when spawned, so you want to spawn early before
> > gui code statements are used.

This should work - and IIRC was the recommended way for some time.  It
relies on you knowning how many thread you'll need before creating any
GUI objects.

> Is there any way to tell perl or the threads module not to make that
> copy? I saw something like this:
>
> sub Win32::GUI::CLONE_SKIP {1};

That's pretty much what Win32::GUI::ThreadUtils does (both for all the
relevant Win32::GUI::* classes).  There's also some code to easy inter-
thread communications, but you can ignore that if you don't need it.

> that would stop the copy, but I'm not sure it was working when I tried
> to use it, though I wasn't sure if I had absolutely covered all the
> different non thread-safe modules that were being used inside these
> (i.e., Win32::GUI::Window might use non-thread-safe Win32::foo::bar
> internally)

Win32::GUI::ThreadUtils should cover all the necessary classes -
unless you are using any GUI classes that are not distributed in the
Win32::GUI package.

> > 2. Never try to access gui widgets from a thread, use shared variables
> > to communicate back to the main thread, and manipulate the widgets
> > from the main thread.
>
> I knew about that, and was/am avoiding it.
>
> Do you think trying to use the GUI elements as shared variables would
> solve it (does sharing simply synchronize the copies or does it stop the
> copying?)

I haven't looked recently, but until very recent threads.pm it wasn't
possible to share blessed objects.  This might work, although it is
important to ensure that the thread that creates the GUI objects
finishes last, so that it is the one that ends up calling DESTROY().

Hope this help,
Rob.


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

Date: Mon, 6 Oct 2008 04:42:26 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Oct  6 2008
Message-Id: <K8Avqq.24ut@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Bundle-Bricolage-1.11.0
http://search.cpan.org/~dwheeler/Bundle-Bricolage-1.11.0/
Modules required to run Bricolage content management system. 
----
Bundle-BricolagePlus-1.11.0
http://search.cpan.org/~dwheeler/Bundle-BricolagePlus-1.11.0/
Optional and Required modules for the Bricolage content management system. 
----
CGI-Lazy-0.11
http://search.cpan.org/~vayde/CGI-Lazy-0.11/
----
Catalyst-Authentication-Credential-OpenID-0.11
http://search.cpan.org/~ashley/Catalyst-Authentication-Credential-OpenID-0.11/
OpenID credential for Catalyst::Plugin::Authentication framework. 
----
Catalyst-Plugin-Cache-Memcached-Fast-0.11
http://search.cpan.org/~vasilus/Catalyst-Plugin-Cache-Memcached-Fast-0.11/
Catalyst Plugin for Cache::Memcached::Fast 
----
Chart-Clicker-2.13
http://search.cpan.org/~gphat/Chart-Clicker-2.13/
Powerful, extensible charting. 
----
Crypt-NSS-0.01
http://search.cpan.org/~claesjac/Crypt-NSS-0.01/
Perl bindings to NSS (Netscape Security Services) 
----
Devel-FindBlessedRefs-1.251
http://search.cpan.org/~jettero/Devel-FindBlessedRefs-1.251/
find all refs blessed under a package 
----
File-Path-2.06_06
http://search.cpan.org/~dland/File-Path-2.06_06/
Create or remove directory trees 
----
Graphics-Primitive-0.35
http://search.cpan.org/~gphat/Graphics-Primitive-0.35/
Device and library agnostic graphic primitives 
----
Graphics-Primitive-Driver-Cairo-0.30
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-Cairo-0.30/
Cairo backend for Graphics::Primitive 
----
Graphics-Primitive-Driver-CairoPango-0.5
http://search.cpan.org/~gphat/Graphics-Primitive-Driver-CairoPango-0.5/
Cairo/Pango backend for Graphics::Primitive 
----
HTML-Feature-2.00006
http://search.cpan.org/~miki/HTML-Feature-2.00006/
Extract Feature Sentences From HTML Documents 
----
IPC-Cmd-0.41_07
http://search.cpan.org/~kane/IPC-Cmd-0.41_07/
finding and running system commands made easy 
----
Lingua-DE-Wortschatz-1.27
http://search.cpan.org/~schroeer/Lingua-DE-Wortschatz-1.27/
wortschatz.uni-leipzig.de webservice client 
----
Locale-Maketext-Lexicon-0.70
http://search.cpan.org/~audreyt/Locale-Maketext-Lexicon-0.70/
Use other catalog formats in Maketext 
----
Locale-Maketext-Lexicon-0.71
http://search.cpan.org/~audreyt/Locale-Maketext-Lexicon-0.71/
Use other catalog formats in Maketext 
----
Mixin-ExtraFields-Driver-DBIC-0.002
http://search.cpan.org/~rjbs/Mixin-ExtraFields-Driver-DBIC-0.002/
store Mixin::ExtraFields data in a DBIx::Class store 
----
Net-DownloadMirror-0.10
http://search.cpan.org/~knorr/Net-DownloadMirror-0.10/
Perl extension for mirroring a remote location via FTP to the local directory 
----
Net-Finger-Server-0.001
http://search.cpan.org/~rjbs/Net-Finger-Server-0.001/
a simple finger server 
----
Net-RTorrent-0.02
http://search.cpan.org/~zag/Net-RTorrent-0.02/
Perl interface to rtorrent via XML-RPC. 
----
Net-UploadMirror-0.13
http://search.cpan.org/~knorr/Net-UploadMirror-0.13/
Perl extension for mirroring a local directory via FTP to the remote location 
----
Parse-Eyapp-1.116
http://search.cpan.org/~casiano/Parse-Eyapp-1.116/
Extensions for Parse::Yapp 
----
RDF-Simple-0.302
http://search.cpan.org/~mthurn/RDF-Simple-0.302/
read and write RDF without complication 
----
RDF-Simple-0.303
http://search.cpan.org/~mthurn/RDF-Simple-0.303/
read and write RDF without complication 
----
RDF-Simple-0.304
http://search.cpan.org/~mthurn/RDF-Simple-0.304/
read and write RDF without complication 
----
Rose-DBx-Object-Renderer-0.37
http://search.cpan.org/~danny/Rose-DBx-Object-Renderer-0.37/
Web UI Rendering for Rose::DB::Object 
----
SVN-Hooks-0.11.390
http://search.cpan.org/~gnustavo/SVN-Hooks-0.11.390/
A framework for implementing Subversion hooks. 
----
SVN-Look-0.11.388
http://search.cpan.org/~gnustavo/SVN-Look-0.11.388/
A caching wrapper aroung the svnlook command. 
----
Sphinx-Control-0.02
http://search.cpan.org/~fayland/Sphinx-Control-0.02/
Simple class to manage a Sphinx searchd 
----
Text-WikiCreole-0.06
http://search.cpan.org/~jburnett/Text-WikiCreole-0.06/
Convert Wiki Creole 1.0 markup to XHTML 
----
Text-WikiCreole-0.07
http://search.cpan.org/~jburnett/Text-WikiCreole-0.07/
Convert Wiki Creole 1.0 markup to XHTML 
----
Tk-Mirror-0.03
http://search.cpan.org/~knorr/Tk-Mirror-0.03/
Perl extension for a graphic user interface to up- or download local and remote directories 
----
XML-ApplyXSLT-0.50
http://search.cpan.org/~jmates/XML-ApplyXSLT-0.50/
convert XML data with XSLT stylesheet files 
----
dvdrip-0.98.9
http://search.cpan.org/~jred/dvdrip-0.98.9/
----
podlators-2.2.0
http://search.cpan.org/~rra/podlators-2.2.0/
----
qn-0.01
http://search.cpan.org/~jrm/qn-0.01/
Perl extension for quoting and splitting on newlines. 
----
rgit-0.01
http://search.cpan.org/~vpit/rgit-0.01/
Recursively execute a command on all the git repositories in a directory tree. 
----
rgit-0.02
http://search.cpan.org/~vpit/rgit-0.02/
Recursively execute a command on all the git repositories in a directory tree. 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Sun, 5 Oct 2008 16:58:30 -0700 (PDT)
From: woodsonturtletw@gmail.com
Subject: Places that are hiring in my area
Message-Id: <4daef5b8-9bd0-415d-ba9a-647691e3d0a2@f63g2000hsf.googlegroups.com>

 .
 .
 .
Enough to seek places that are hiring! You've already found the best
site!
Visit link below!
************************************
http://med247.us/?p=job+hiring
************************************
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 .
 In days gone by there was a land where the nights were always
dark,and the sky spread over places that are hiring like a black
cloth, for there the moonnever rose, and no star shone in the gloom.
In days gone by there was a land where the nights were always dark,and
the sky spread over now hiring like a black cloth, for there the
moonnever rose, and no star shone in the gloom. In days gone by there
was a land where the nights were always dark,and the sky spread over
jobs hiring in my area like a black cloth, for there the moonnever
rose, and no star shone in the gloom. In days gone by there was a land
where the nights were always dark,and the sky spread over fast hiring
jobs like a black cloth, for there the moonnever rose, and no star
shone in the gloom. In days gone by there was a land where the nights
were always dark,and the sky spread over who's hiring right now like a
black cloth, for there the moonnever rose, and no star shone in the
gloom. The Fairy said to him:   "You know that the Princess has a
great cat which jobs for 14 year olds is very fond of.


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

Date: Sun, 05 Oct 2008 21:31:55 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: Problems flushing my buffer! (perl)
Message-Id: <r9KdnS0J7ochCXTVnZ2dnUVZ_j2dnZ2d@comcast.com>

Larry wrote:

> syswrite STDOUT, "hello world!\n";
> sleep 10;
> syswrite STDOUT, "hello world!\n";

That won't do it.  But this will:

   print "Hello, world<hr>\n";
   sleep 10;
   print "<h3>Hello, world</h3>\n";

Outside of <pre></pre>, the browser treats "\n" like " ", and does not output
the current paragraph until seeing a tag that terminates it and/or starts a new one.

It may be possible to convince the browser to act differently using CSS; I don't know.

	-Joe


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

Date: Mon, 6 Oct 2008 00:52:20 -0400
From: Paul Arthur <flowerysong00@yahoo.com>
Subject: Re: Problems flushing my buffer! (perl)
Message-Id: <slrngej6c4.740.flowerysong00@shasta.marwnad.com>

On 2008-10-06, Joe Smith <joe@inwap.com> wrote:
> Larry wrote:
>
>> syswrite STDOUT, "hello world!\n";
>> sleep 10;
>> syswrite STDOUT, "hello world!\n";
>
> That won't do it.  But this will:
>
>    print "Hello, world<hr>\n";
>    sleep 10;
>    print "<h3>Hello, world</h3>\n";
>
> Outside of <pre></pre>, the browser treats "\n" like " ", and does not output
> the current paragraph until seeing a tag that terminates it and/or starts a new one.
>
> It may be possible to convince the browser to act differently using CSS; I don't know.

You obviously didn't notice
>> syswrite STDOUT "Content-type: text/plain\n\n";

-- 
Cool, I almost got called a "cracker".
From: Talon


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

Date: Sun, 05 Oct 2008 18:54:19 -0400
From: Bob Walton <bwalton@nospam.invalid>
Subject: Re: simple CGI and ASP
Message-Id: <48e94598$0$21304$9a6e19ea@unlimited.newshosting.com>

isecc wrote:
 ...
> The scenario is unix box+apache+asp+perl.
> 
> I've the following code:
 ...
> if I use the POST method in the form I'm not able to read the value
> passed by the form.
> Instead if I use the GET I'm able to get the information.
> 
> Any ideas?

I'm unable to duplicate your problem using Apache 2.2, Perl 5.8.8 
(ActiveState build 822) with normal CGI, Firefox 3.0.2, all on Windows 
XP SP3 (with, of course, "print $web->header;" added).  Works fine with 
either GET or POST.  Might be something with ASP?  I doubt it has 
anything to do with Perl.

> TIA.

HTH.


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

Date: Mon, 06 Oct 2008 00:40:41 +0200
From: Larry <dontmewithme@got.it>
Subject: sysread
Message-Id: <dontmewithme-0631EF.00404106102008@news.tin.it>

I have just read up on sysread and I was struck by the following:

"*Attempts* to read LENGTH characters of data into variable SCALAR from 
the specified FILEHANDLE, using the system call read(2)."

It made me wonder. What does that mean by "attemps" ?

I'm writing up a script to get binary data from <STDIN> (the script is 
run on a normal web server and the data is sent to it by using http's 
POST method)

I have a binary header on top of the raw data so here's what I'm doing:

# Get the header size: (4 bytes, int32)
sysread(\*STDIN, $buf, 4);

# Get the header:
sysread(\*STDIN, $header, unpack("N", $buf) );

# Get the raw data:
while( sysread(\*STDIN, $raw, 2048) )
{
   ...raw data...
}

close STDIN;

__END__;

Suppose sysread was to read a long header data like 65000 bytes, will 
sysread actually be able to read all the data and store it on $header? 
Do you think I should deal with that another way?

any help will be apreciated,

thanks


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

Date: Sun, 5 Oct 2008 17:47:39 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: sysread
Message-Id: <slrngeih0b.4c2.tadmc@tadmc30.sbcglobal.net>

Larry <dontmewithme@got.it> wrote:
> I have just read up on sysread and I was struck by the following:
>
> "*Attempts* to read LENGTH characters of data into variable SCALAR from 
> the specified FILEHANDLE, using the system call read(2)."
>
> It made me wonder. What does that mean by "attemps" ?


It may fail for the reasons given later in that same paragraph of the docs.


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


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

Date: Sun, 05 Oct 2008 19:22:13 -0400
From: Bob Walton <bwalton@nospam.invalid>
Subject: Re: sysread
Message-Id: <48e94c23$0$21331$9a6e19ea@unlimited.newshosting.com>

Larry wrote:
> I have just read up on sysread and I was struck by the following:
> 
> "*Attempts* to read LENGTH characters of data into variable SCALAR from 
> the specified FILEHANDLE, using the system call read(2)."
> 
> It made me wonder. What does that mean by "attemps" ?

I think it means exactly what is says -- depending upon what the state 
of FILEHANDLE is at the moment, the attempt may succeed or fail at 
reading LENGTH characters.  For example, the FILEHANDLE could encounter 
end-of-file during the attempt to read LENGTH characters.  You should 
check the return value from sysread() to see what happened -- there is 
quite a variety of possible outcomes.  If it generated an error, you 
should also check $! to see what the error was.

 ...

> 
> Suppose sysread was to read a long header data like 65000 bytes, will 
> sysread actually be able to read all the data and store it on $header? 
> Do you think I should deal with that another way?

Perl in general has as few limitations on data size as possible. 
Depending on your computer and OS resources, 65_000 bytes should be 
totally no problem.  Even 65_000_000 should be no problem, although it 
might generate a noticeable delay.

 ...


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

Date: 05 Oct 2008 23:29:09 GMT
From: xhoster@gmail.com
Subject: Re: sysread
Message-Id: <20081005192912.762$Lz@newsreader.com>

Larry <dontmewithme@got.it> wrote:
> I have just read up on sysread and I was struck by the following:
>
> "*Attempts* to read LENGTH characters of data into variable SCALAR from
> the specified FILEHANDLE, using the system call read(2)."
>
> It made me wonder. What does that mean by "attemps" ?

If an error occurs, then it may not read the requested number of bytes.
If eof is reached, then it may not read the requested number of bytes.

If there is more than zero but less than the requested number of bytes
ready to be read, then the sysread will read just the number of bytes
that are currently ready, and not wait for the full requested number to
become ready.  (If O_NONBLOCK is in effect, then strike "more than zero
but" from the above)

There maybe other instances where the attempt fails, like if the call gets
interrupted by a signal or something.  It would be highly system dependent.

> I'm writing up a script to get binary data from <STDIN> (the script is
> run on a normal web server and the data is sent to it by using http's
> POST method)
>
> I have a binary header on top of the raw data so here's what I'm doing:
>
> # Get the header size: (4 bytes, int32)
> sysread(\*STDIN, $buf, 4);

It might be possible, but extremely unlikely, that this could return early
after reading less than 4 bytes, even in the absence of an error condition.
If I had to use sysread, I'd probably take that chance, myself.  But why
not just use read?  That will restart as needed until it gets 4 bytes,
unless there are errors.


>
> # Get the header:
> sysread(\*STDIN, $header, unpack("N", $buf) );
>
> # Get the raw data:
> while( sysread(\*STDIN, $raw, 2048) )
> {
>    ...raw data...
> }
>
> close STDIN;
>
> __END__;
>
> Suppose sysread was to read a long header data like 65000 bytes, will
> sysread actually be able to read all the data and store it on $header?

It will be able to, but it might not do so reliably.


> Do you think I should deal with that another way?

I'd probably just use "read"?

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.


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

Date: Mon, 6 Oct 2008 01:52:01 +0200
From: "Petr Vileta \(fidokomik\)" <stoupa@practisoft.cz>
Subject: Re: What does m@ stand for in the following regular expression.
Message-Id: <gcbjve$pqj$1@aioe.org>

QoS@domain.invalid wrote:
> grocery_stocker <cdalten@gmail.com> wrote in message-id:
> <21d009de-7b8b-47af-b156-099716358217@i76g2000hsf.googlegroups.com>
>
>>
>> Given
>>
>> my ($title) = ($body =~ m@<title>\s*(.*?)\s*</title>@si);
>>
>>
>> What does m@ do in this case?
>
> m = match
> @ = marks the beginning and end of the regular expression

For regular expresion you can use your own parentheses, so @ is parentheses in 
this case. You can write it as

my ($title) = ($body =~ m{<title>\s*(.*?)\s*</title>}si);

or

my ($title) = ($body =~ m#<title>\s*(.*?)\s*</title>#si);

or

my ($title) = ($body =~ m/<title>\s*(.*?)\s*<\/title>/si);


-- 
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: Sun, 5 Oct 2008 23:30:53 -0700 (PDT)
From: Michael Paoli <michael1cat@yahoo.com>
Subject: Re: What does m@ stand for in the following regular expression.
Message-Id: <48aff5e5-d3dd-4980-a8d9-c340eaa3abbe@a29g2000pra.googlegroups.com>

On Sep 27, 6:47 am, grocery_stocker <cdalten@gmail.com> wrote:
> my ($title) = ($body =~ m@<title>\s*(.*?)\s*</title>@si);
> What does m@ do in this case?

The what has already been addressed by several folks.

As to the why:
http://en.wikipedia.org/wiki/Leaning_toothpick_syndrome


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

Date: Sun, 5 Oct 2008 17:22:09 -0700 (PDT)
From: grocery_stocker <cdalten@gmail.com>
Subject: What's the difference between *ERROR and \*ERROR in the following  code
Message-Id: <7ae5c87e-ac6c-49ac-b464-8d4589789bb5@m44g2000hsc.googlegroups.com>

When I take a glob reference to ERROR....

m-net% more mv.pl
#!/usr/bin/perl -w

use IPC::Open3;

local (*READ, *WRITE, *ERROR);

$pid = open3(\*READ, \*WRITE, \*ERROR, 'mv abc /efg');

waitpid($pid, 0);
if($?) {
    warn "exit code = ", $?>>8, "\n";
    my $result = <ERROR>;
    print $result;

}

I get....
m-net% ./mv.pl
exit code = 1
mv: rename abc to /efg: No such file or directory


But when I DON'T take a glob reference to ERROR, I get the same thing.
m-net% more mv2.pl
#!/usr/bin/perl -w

use IPC::Open3;

local (*READ, *WRITE, *ERROR);

$pid = open3(*READ, *WRITE, *ERROR, 'mv abc /efg');

waitpid($pid, 0);
if($?) {
    warn "exit code = ", $?>>8, "\n";
    my $result = <ERROR>;
    print $result;

}

m-net% ./mv2.pl
exit code = 1
mv: rename abc to /efg: No such file or directory
m-net%

Why is this?


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

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


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