[27992] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9356 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 23 11:05:47 2006

Date: Fri, 23 Jun 2006 08:05:06 -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, 23 Jun 2006     Volume: 10 Number: 9356

Today's topics:
    Re: Binding array to pattern (Seymour J.)
    Re: Construction of a non-regexable subset of the set o <glennj@ncf.ca>
    Re: Construction of a non-regexable subset of the set o <David.Squire@no.spam.from.here.au>
    Re: Construction of a non-regexable subset of the set o <tzz@lifelogs.com>
    Re: extracting regular expressions <xicheng@gmail.com>
    Re: FAQ 4.30 How do I capitalize all the words on one l <thundergnat@hotmail.com>
    Re: Find repeating substring <thundergnat@hotmail.com>
    Re: Find repeating substring <msgrinnell@charter.net>
    Re: Help Required !!!! <jurgenex@hotmail.com>
    Re: Online Graphing Calculator - Perl Backend <hawk007@flight.us>
    Re: Problem with Multi- threaded Server <tzz@lifelogs.com>
    Re: question on printing to /dev/lp <"v.niekerk at hccnet.nl">
    Re: question on printing to /dev/lp <David.Squire@no.spam.from.here.au>
    Re: question on printing to /dev/lp <"v.niekerk at hccnet.nl">
    Re: Running another program in daemon server <tzz@lifelogs.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 23 Jun 2006 09:08:12 -0300
From: "Shmuel (Seymour J.) Metz" <spamtrap@library.lspace.org.invalid>
Subject: Re: Binding array to pattern
Message-Id: <449be7bc$1$fuzhry+tra$mr2ice@news.patriot.net>

In <slrne9me6h.5tf.tadmc@magna.augustmail.com>, on 06/22/2006
   at 07:41 PM, Tad McClellan <t...@augustmail.com> said:

>We did not know the "real world" when I pointed out that bug

When you don't know the real world then your have no way of knowing
whether a bug is possible. Further, you kept nattering about the
imaginary bug *after* you had seen the code.

No, there is a potential bug that it might have made sense to ask
about; my code might fail if you set $" to a null string.

>There is if there is a space in /pattern/

If your grandmother had wheels she'd be a wagon. You kept on referring
to your imaginary bug *after* you had seen that there was no space in
the /abuse/ pattern.

>Because by then you had revealed what "your case" was. That had not
>yet been revealed when I pointed out a bug. I cannot see the future.

You also cannot see the past. You seem to be careless in your reading
of news articles and to be appallingly ignorant of languages other
than Perl. There isn't a SNOBOL's chance in Hell that I would take
your unsupported word on anything.

>It was not imaginary, it was entirely possible with the information
>that was available at the time I wrote it.

Not the second time you wrote it.

>Your approach was to concatenate all of the elements together, and
>add a space character between each element.

No, my approach was to add $" between elements.

-- 
Shmuel (Seymour J.) Metz, SysProg and JOAT  <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action.  I reserve the
right to publicly post or ridicule any abusive E-mail.  Reply to
domain Patriot dot net user shmuel+news to contact me.  Do not
reply to spamtrap@library.lspace.org



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

Date: 23 Jun 2006 14:22:04 GMT
From: Glenn Jackman <glennj@ncf.ca>
Subject: Re: Construction of a non-regexable subset of the set of all strings
Message-Id: <slrne9nu8c.ee4.glennj@smeagol.ncf.ca>

At 2006-06-23 08:45AM, Dominic van der Zypen <dominic.zypen@gmail.com> wrote:
>  Hello,
>  
>  I have a question which I am afraid might seem "overly scientific" (not
>  to say nutty), but which I find is quite natural after all.
>  
>  If we look at the set S of all finite strings, then each regex
>  represents some subset of S. For instance, h(a|e)ndel is the set
>  consisting of handel and hendel; and the regex .+ represents the set
>  of all non-empty strings not containing \n.
>  
>  I wondered whether there is a "non-regexable" subset N of S (i.e. a
>  subset N for which there is no regex representing N) and came up with
>  a (non-constructive) positive answer from set theory: there are
>  uncountably many subsets of S, but there are only countably many
>  regular expressions, so there are non-regexable subsets.
>  
>  What I would like to know is whether one can construct a subset N of S
>  which is non-regexable (and whether it is hard to prove that N has the
>  desired property).

It seems to me that, for every string x in S, one can construct at least
one regular expression to match it, i.e. ^x$

-- 
Glenn Jackman
Ulterior Designer


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

Date: Fri, 23 Jun 2006 15:31:09 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: Construction of a non-regexable subset of the set of all strings
Message-Id: <e7gtvd$q1a$1@news.ox.ac.uk>

Glenn Jackman wrote:
> At 2006-06-23 08:45AM, Dominic van der Zypen <dominic.zypen@gmail.com> wrote:
>>  Hello,
>>  
>>  I have a question which I am afraid might seem "overly scientific" (not
>>  to say nutty), but which I find is quite natural after all.
>>  
>>  If we look at the set S of all finite strings, then each regex
>>  represents some subset of S. For instance, h(a|e)ndel is the set
>>  consisting of handel and hendel; and the regex .+ represents the set
>>  of all non-empty strings not containing \n.
>>  
>>  I wondered whether there is a "non-regexable" subset N of S (i.e. a
>>  subset N for which there is no regex representing N) and came up with
>>  a (non-constructive) positive answer from set theory: there are
>>  uncountably many subsets of S, but there are only countably many
>>  regular expressions, so there are non-regexable subsets.
>>  
>>  What I would like to know is whether one can construct a subset N of S
>>  which is non-regexable (and whether it is hard to prove that N has the
>>  desired property).
> 
> It seems to me that, for every string x in S, one can construct at least
> one regular expression to match it, i.e. ^x$
> 

Yes, but the set of all subsets of S is not the same as the set of 
single strings in S (i.e. S).

DS


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

Date: Fri, 23 Jun 2006 10:52:13 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Construction of a non-regexable subset of the set of all strings
Message-Id: <g69y7vnq602.fsf@CN1374059D0130.kendall.corp.akamai.com>

On 23 Jun 2006, dominic.zypen@gmail.com wrote:

> I wondered whether there is a "non-regexable" subset N of S (i.e. a
> subset N for which there is no regex representing N) and came up with
> a (non-constructive) positive answer from set theory: there are
> uncountably many subsets of S, but there are only countably many
> regular expressions, so there are non-regexable subsets.

> What I would like to know is whether one can construct a subset N of S
> which is non-regexable (and whether it is hard to prove that N has the
> desired property).

(S: set of all finite strings)

I assume by "regexable" you mean "uniquely regexable", meaning that
the regular expression would not match S-N.

Any finite subset N of S would be regexable, since you can construct a
regular expression that does an OR of all the finite strings in N.

Some infinite subsets (e.g. all the strings that begin with "a") could
be regexable, but generally you can't uniquely match a random infinite
collection of strings with a regular expression, since there's nothing
for the regular expression to "latch" onto.  I'm sure there's a more
rigorous analysis, perhaps using the Huffman distance, but I would say
that if a set is infinite and constructed without a specific set of
rules, it's not possible in finite time to *build* a regular
expression to match only that set.

Ted


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

Date: 23 Jun 2006 07:40:34 -0700
From: "Xicheng Jia" <xicheng@gmail.com>
Subject: Re: extracting regular expressions
Message-Id: <1151073634.413595.256740@b68g2000cwa.googlegroups.com>

Nospam wrote:
> "Xicheng Jia" <xicheng@gmail.com> wrote in message
> news:1150907933.364748.49710@i40g2000cwc.googlegroups.com...
> > Nospam wrote:
> > > I am wondering say I had a string, en email address sample@example.com
> and I
> > > wanted to ignore everything from the @ and place in a variable, would
> > > something like this suffice:
> > >
> > > #! usr/bin/perl
> > > use warnings;
> > > use strict;
> > > my $var1= sample@example.com;
> > >
> > > my $var2 = $var !=~ m/(\@*.$)(.*)/s;
> > >
> > > however I am not making any progress and looking at perltut I am unable
> to
> > > find a regular expression to do just this
> >
> > (my $var2 = $var1) = ~s/\@.*//;
> >
> > this will assign 'sample' to $var2
> >
> > Xicheng
> >
>
> Tried to print out $var2 all I received was a number and not the actual
> text:
>
> #! usr/bin/perl
> use warnings;
> use strict;
> my $var1= "sample\@example.com";
>

 (my $var2 = $var1) =~ s/\@.*//;

Sorry for that typo.. As Anno said, it's not a good way to do it that
way. I'd use "split" in my code..

  my $var2 = (split '@', $var1, 2)[0];

Xicheng



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

Date: Fri, 23 Jun 2006 09:47:14 -0400
From: thundergnat <thundergnat@hotmail.com>
Subject: Re: FAQ 4.30 How do I capitalize all the words on one line?
Message-Id: <1qWdnZHvJPl-bQbZnZ2dnUVZ_qqdnZ2d@rcn.net>

PerlFAQ Server wrote:

> 
>             $string =~ s/ (
>                                      (^\w)    #at the beginning of the line
>                                        |      # or
>                                      (\s\w)   #preceded by whitespace
>                                        )
>                                     /\U$1/xg;
Misses words with leading punctuation. e.g. "this", 'that' & (other)


> 
>             $string =~ /([\w']+)/\u\L$1/g;
------------------------^ syntax error, missing s

Misses words with leading single quote. e.g. 'this'




How about something like:

$string =~ s/(\w+('\w+)?)/\u\L$1/g;

or (Unicode aware)

$string =~ s/(\p{Alnum}+('\p{Alnum}+)?)/\u\L$1/g;

though this will render mother-in-law as Mother-In-Law, which may or
may not be desirable. Could use

$string =~ s/(\w+(['-]\w+)*)/\u\L$1/g;

if it is a problem, though that may open its own can of worms.


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

Date: Fri, 23 Jun 2006 09:48:35 -0400
From: thundergnat <thundergnat@hotmail.com>
Subject: Re: Find repeating substring
Message-Id: <1qWdnZDvJPmubAbZnZ2dnUVZ_qqdnZ2d@rcn.net>

Mike wrote:
> What I have is 24,000 lines of ICD9 index entries with appended codes
> that used to be stored in a format like below and processed one time
> per year by an OS390 (then printed out).  These are index entries for
> ICD9 codes that now have been moved to a web service.  The web services
> are all "code-centric" and the index entries are just properties of the
> codes now.  The gist of the problem is that I need to format each entry
> (for example that of ablation) into a tree-view that users can peruse
> for codes.  I believe I can do this recursively be reading each string
> until the first word changes then pulling the repeating first and
> subsequent words (which are then the root).  Then, remove the root and
> process what is left of each substring in turn until the base case is
> hit (no repeating substrings).
> 
> The owner of the webservices is not willing to change the format of the
> data.  I may be able to do a one-time process (Perl) or on-demand
> depending on performance.
> 
> A tree view would look like
> 
> Ablation
>    Endometrial (Hysteroscopic) 68.23
>    Heart (Conduction Defect) 27.33/2
>       With Catheter 37.34/2
>    Inner Ear (Cryosurgery) (Ultrasound) 20.79/4
>       By Injection 20.72
>    Lesion Heart
>       By Peripherally Inserted Catheter 37.34
> 
> etc etc.....
> 
> The raw index entries would look like below.
> 
> ABLATION ENDOMETRIAL (HYSTEROSCOPIC)	68.23
> ABLATION HEART (CONDUCTION DEFECT)	37.33/2
> ABLATION HEART (CONDUCTION DEFECT) WITH CATHETER	37.34/2
> ABLATION INNER EAR (CRYOSURGERY) (ULTRASOUND)	20.79/4
> ABLATION INNER EAR (CRYOSURGERY) (ULTRASOUND) BY INJECTION	20.72
> ABLATION LESION HEART BY PERIPHERALLY INSERTED CATHETER	37.34
> ABLATION LESION HEART ENDOVASCULAR APPROACH	37.34
> ABLATION LESION HEART MAZE PROCEDURE (COX-MAZE) ENDOVASCULAR
> APPROACH	37.34
> ABLATION LESION HEART MAZE PROCEDURE (COX-MAZE) OPEN (TRANS-THORACIC)
> APPROACH	37.33
> ABLATION LESION HEART MAZE PROCEDURE (COX-MAZE) TRANS-THORACIC
> APPROACH	37.33
> ABLATION PITUITARY	7.69
> ABLATION PITUITARY BY COBALT-60	92.32
> ABLATION PITUITARY BY IMPLANTATION (STRONTIUM-YTTRIUM) (Y) NEC	92.39
> ABLATION PITUITARY BY PROTON BEAM (BRAGG PEAK)	92.33
> ABLATION PROSTATE (ANAT = 59.02) BY LASER, TRANSURETHRAL	60.21
> ABLATION PROSTATE (ANAT = 59.02) BY RADIOFREQUENCY THERMOTHERAPY	60.97
> ABLATION PROSTATE (ANAT = 59.02) BY TRANSURETHRAL NEEDLE ABLATION
> (TUNA)	60.97
> ABLATION PROSTATE (ANAT = 59.02) PERINEAL BY CRYOABLATION	60.62
> ABLATION PROSTATE (ANAT = 59.02) PERINEAL BY RADICAL CRYOSURGICAL
> ABLATION (RCSA)	60.62
> ABLATION PROSTATE (ANAT = 59.02) TRANSURETHRAL BY LASER	60.21
> ABLATION PROSTATE (ANAT = 59.02) TRANSURETHRAL CRYOABLATION	60.29
> ABLATION PROSTATE (ANAT = 59.02) TRANSURETHRAL RADICAL CRYOSURGICAL
> ABLATION (RCSA)	60.29
> ABLATION TISSUE HEART - SEE ABLATION, LESION, HEART	0
> ABLATION VESICLE NECK (ANAT = 60.02)	57.91
> 

Ho hum. I was bored so I farted around with this for a bit.

Not particularly elegant or fast but...


use warnings;
use strict;

my @file;
my $lastline = '';
my $partline = '';

while ( my $line = <DATA> ) {
     chomp $line;
     $line = "$partline $line" if length $partline;
     if ( $line =~ /\D$/ ) {
         $partline = $line;
         next;
     }
     else {
         $partline = '';
     }
     $line =~ s/(\w+('\w+)?)/\u\L$1/g;
     push @file, $line;
}

my $level  = 0;
my $prefix = '';
my @step;
my $prev = shift @file;
my $tab  = '    ';

while (@file) {
     ( $level, $prefix, $prev ) =
       buildtree( $level, $prefix, shift @file, $prev );
}
buildtree( $level, $prefix, $prefix, $prev );


sub buildtree {
     my ( $level, $prefix, $next, $prev ) = @_;
     my $common = join ' ', greatest_common_prefix( $prev, $next );
     if ( $common eq $prefix ) {
         $prev =~ s/^\Q$prefix\E\s*//;
         print $tab x $level, $prev, "\n";
     }
     elsif ( length $common > length $prefix ) {
         $prev =~ s/^\Q$common\E\s*//;
         my $trim = $common;
         $common =~ s/^\Q$prefix\E\s*//;
         push @step, $common;
         print $tab x $level, $common;
         if ( $prev !~ /[ \p{Alpha}]/ ) {
             print "\t$prev\n";
             $level = @step;
         }
         else {
             $level = @step;
             print "\n", $tab x $level, $prev, "\n";
         }
         $prefix = $trim;
     }
     elsif ( length $common < length $prefix ) {
         $prev =~ s/^\Q$prefix\E\s*//;
         print $tab x $level, $prev, "\n";
         my @newstep;
         my $test = $next;
         for (@step) {
             last unless $test =~ s/\Q$_\E\s*//;
             push @newstep, $_;
         }
         @step   = @newstep;
         $level  = @step;
         $prefix = $common;
     }
     return ( $level, $prefix, $next );
}

sub greatest_common_prefix {
     no warnings 'uninitialized';
     my ( $first, $second ) = @_;
     my @first  = split ' ', $first;
     my @second = split ' ', $second;
     my @gcp;
     for (@first) {
         if ( $_ eq shift @second ) {
             push @gcp, $_;
         }
         else {
             last;
         }
     }
     return @gcp;
}

__DATA__
ABLATION ENDOMETRIAL (HYSTEROSCOPIC)	68.23
ABLATION HEART (CONDUCTION DEFECT)	37.33/2
ABLATION HEART (CONDUCTION DEFECT) WITH CATHETER	37.34/2
ABLATION INNER EAR (CRYOSURGERY) (ULTRASOUND)	20.79/4
ABLATION INNER EAR (CRYOSURGERY) (ULTRASOUND) BY INJECTION	20.72
ABLATION LESION HEART BY PERIPHERALLY INSERTED CATHETER	37.34
ABLATION LESION HEART ENDOVASCULAR APPROACH	37.34
ABLATION LESION HEART MAZE PROCEDURE (COX-MAZE) ENDOVASCULAR
APPROACH	37.34
ABLATION LESION HEART MAZE PROCEDURE (COX-MAZE) OPEN (TRANS-THORACIC)
APPROACH	37.33
ABLATION LESION HEART MAZE PROCEDURE (COX-MAZE) TRANS-THORACIC
APPROACH	37.33
ABLATION PITUITARY	7.69
ABLATION PITUITARY BY COBALT-60	92.32
ABLATION PITUITARY BY IMPLANTATION (STRONTIUM-YTTRIUM) (Y) NEC	92.39
ABLATION PITUITARY BY PROTON BEAM (BRAGG PEAK)	92.33
ABLATION PROSTATE (ANAT = 59.02) BY LASER, TRANSURETHRAL	60.21
ABLATION PROSTATE (ANAT = 59.02) BY RADIOFREQUENCY THERMOTHERAPY	60.97
ABLATION PROSTATE (ANAT = 59.02) BY TRANSURETHRAL NEEDLE ABLATION
(TUNA)	60.97
ABLATION PROSTATE (ANAT = 59.02) PERINEAL BY CRYOABLATION	60.62
ABLATION PROSTATE (ANAT = 59.02) PERINEAL BY RADICAL CRYOSURGICAL
ABLATION (RCSA)	60.62
ABLATION PROSTATE (ANAT = 59.02) TRANSURETHRAL BY LASER	60.21
ABLATION PROSTATE (ANAT = 59.02) TRANSURETHRAL CRYOABLATION	60.29
ABLATION PROSTATE (ANAT = 59.02) TRANSURETHRAL RADICAL CRYOSURGICAL
ABLATION (RCSA)	60.29
ABLATION TISSUE HEART - SEE ABLATION, LESION, HEART	0
ABLATION VESICLE NECK (ANAT = 60.02)	57.91



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

Date: 23 Jun 2006 07:46:20 -0700
From: "Mike" <msgrinnell@charter.net>
Subject: Re: Find repeating substring
Message-Id: <1151073980.804585.250630@i40g2000cwc.googlegroups.com>


> Ho hum. I was bored so I farted around with this for a bit.
>
> Not particularly elegant or fast but...

Bored?  I am relatively easily impressed.  Performance will continue to
be a problem if my users want to be able to pull these index trees
real-time.  

Mike



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

Date: Fri, 23 Jun 2006 13:47:05 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Help Required !!!!
Message-Id: <thSmg.2288$Yk.1539@trnddc06>

vandana wrote:

Please put the subject of your post into the Subject of your post

> # strip (trailing) filename from path, leaving directory only

There are ready-made modules for that task (See File::Basename) which are 
tried and proven and work regardless of the platform used.

> my ($path) = $ENV{'PATH_TRANSLATED'} =~ m|(^.*)\\|;
>
> It removes trailing filename from path.
> Can anyone help me to
> understand the working of
> m|(^.*)\\|; in above command.

See perldoc perlop for the 'm' operator.
See perldoc perlretut and perldoc perlre for the RE.

jue 




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

Date: 23 Jun 2006 06:28:09 -0700
From: "Andrew" <hawk007@flight.us>
Subject: Re: Online Graphing Calculator - Perl Backend
Message-Id: <1151069289.127084.265070@u72g2000cwu.googlegroups.com>

robby.walker@gmail.com wrote:
> Hi,
>
> I've just released a full-featured online graphing calculator at
> http://www.e-tutor.com/et2/graphing/ - the back end is built with
> (mod_)Perl and GD.
>
> It requires no downloads or plugins - just JavaScript.  You can track
> points on the curve, graph multiple functions, and more.  I'm also
> interested in hearing people's feature requests.
>
> If you really like it, please consider digging it:
>
> http://digg.com/software/Online_Graphing_Calculator_2
>
> or voting for it on reddit.com

Is this under GPL / open source? I couldn't find the licensing info.
are you selling this software or services related thereto?

andrew



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

Date: Fri, 23 Jun 2006 11:02:49 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Problem with Multi- threaded Server
Message-Id: <g69psgzq5ie.fsf@CN1374059D0130.kendall.corp.akamai.com>

On 23 Jun 2006, janicehwang1325@yahoo.com wrote:

> I post the program before, however, based on the response, i simplify
> my server code in the following. I still got error when the clients on
> the same LAN trying to connect to the server it gives me segmentation
> fault error. What is the cause? For your information, the prefork
> server runs perfectly well without any errors. However, due to
> specification, i need to design my server handling multiple clients
> using threads.

Hello,

thanks for posting complete code.  Now you know:

- the DBI+SSL server works without threads

Next, find out if:

- the threaded server works without SSL
- the threaded server works without DBI
- the threaded server works without SSL and DBI (trivial case, but needed)

I would say at this point it's very likely you're hitting a bug, so
find out where it is...  Then you can try to avoid the bug and you can
tell the developers about it.

Ted


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

Date: Fri, 23 Jun 2006 16:32:17 +0200
From: Huub <"v.niekerk at hccnet.nl">
Subject: Re: question on printing to /dev/lp
Message-Id: <449bf6bb$0$13713$e4fe514c@dreader25.news.xs4all.nl>

> 
> No, I don't. I mean e.g. 
> 
>     open my $LPR, '|-', qw/lpr -Pprinter/ or die "can't fork lpr: $!";
> 

Reading CPAN on open & pipes, I still don't quite understand it. I 
assume $LPR is the data to be printed, printer is of course the 
printerqueue. But where do I put the filename? I suppose I completely 
miss the point somewhere.
Thank you for helping out.


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

Date: Fri, 23 Jun 2006 15:44:15 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: question on printing to /dev/lp
Message-Id: <e7gunv$qch$1@news.ox.ac.uk>

Huub wrote:
>>
>> No, I don't. I mean e.g.
>>     open my $LPR, '|-', qw/lpr -Pprinter/ or die "can't fork lpr: $!";
>>
> 
> Reading CPAN on open & pipes, I still don't quite understand it. I 
> assume $LPR is the data to be printed

No. $LPR is the filehandle that is bound to the pipe.

, printer is of course the
> printerqueue. But where do I put the filename? I suppose I completely 
> miss the point somewhere.

There is no filename. You have a pipe, not a file. Anything you print to 
the filehandle $LPR will be sent via the pipe to the command 'lpr 
-Pprinter'.

Consider this command line version:

 >cat myfile.ps | lpr -Pprinter1

Here the output of the command 'cat myfile.ps' is piped into the input 
of the command 'lpr -Pprinter1'.

HTH,

DS


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

Date: Fri, 23 Jun 2006 16:59:48 +0200
From: Huub <"v.niekerk at hccnet.nl">
Subject: Re: question on printing to /dev/lp
Message-Id: <449c01e7$0$10579$e4fe514c@dreader21.news.xs4all.nl>

> No. $LPR is the filehandle that is bound to the pipe.
> 

OK.

> There is no filename. You have a pipe, not a file. Anything you print to 
> the filehandle $LPR will be sent via the pipe to the command 'lpr 
> -Pprinter'.
> 
> Consider this command line version:
> 
>  >cat myfile.ps | lpr -Pprinter1
> 
> Here the output of the command 'cat myfile.ps' is piped into the input 
> of the command 'lpr -Pprinter1'.

So if I put the open function first, and then this:

print($LPR,"                                           Contr. 2007\n");

it should pipe the string to the printer?


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

Date: Fri, 23 Jun 2006 10:57:37 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Running another program in daemon server
Message-Id: <g69u06bq5r2.fsf@CN1374059D0130.kendall.corp.akamai.com>

On 22 Jun 2006, janicehwang1325@yahoo.com wrote:

> The directory is changed to the root directory. However, i try to run
> another program using `\path\to\perl \path\to\client.pl` still doesn't
> work. is there any other solutions?

You may be specifying the path as "\path\to\perl" which won't work.
You need to either use "\\path\\to\\perl" or '\path\to\perl' (single
quotes) or "/path/to/perl".

(ditto for the path to the client)

Generally specify paths for system() with '/' instead of '\' and life
will be easier and more portable.

Ted


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

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


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