Re: confused by use of 'implied' variable

2013-04-05 Thread will trillich
Greg --

The "shortcuts" us the perl variable $_. That is, when no specific argument
is supplied, $_ is used by default.

  s/x/y/;
  while ( <> ) {...}
  print;

All the above and more expect a value to work with, and if none is given,
perl uses $_ by default.

You get into trouble when you have a loop that refers to $_ which then
calls a subroutine that does something else with $_...

See http://perldoc.perl.org/perlvar.html#General-Variables for details on
$_.

Your $aggregated_file_contents example wouldn't work, by the way: there's
no default variable in that context. You'd have to do this:

  $aggregated_file_contents .= $_ ;

Hope this helps!



On Friday, April 5, 2013, Greg VisionInfosoft wrote:

> im butchering a public script i found on the internet for purpose of doing
> a CGI file upload.
>
> theres one excerpt from the script that ive never used before.  the few
> lines...
>
> while ( <$upload_filehandle> ) {
>print UPLOADFILE;
> }
>
> if it were me, i would not write code this way, i write in a way that make
> it easier for me to quickly understand what i was trying to do.  if it were
> me coding this in my 'lame' (for idiots) way, it would look more like...
>
> while ( $data = <$upload_filehandle> ) {
>print UPLOADFILE $data;
> }
>
> but now that ive seen the code, as originally presented, it does cause me
> to ask the question...
>
> how does one know under what set of circumstances can such 'abbreviated'
> code be written?  in other words, how can one know what kinds of features
> or operations can use the implied variable @_ (which I assume is the
> variable that would be used in this case).
>
> specifically, if i wanted to append to a variable
> $aggregated_file_contents, each new block of the file as it was being read
> and output...
>
> my thought was to try:
>
> while ( <$upload_filehandle> ) {
>print UPLOADFILE;
>$aggregated_file_contents.=;
> }
>
> as opposed to what i would have normally done ($aggregated_file_contents
> .= $data;)
>
> yes, i know i can simply try it, to see if it works - but is there a more
> general rule one can follow that tells them when this kind of thing can
> normally be used, versus when not?
>
> thanks alot for any insights here
>
> greg
>


-- 
 Will Trillich :: 812.454.6431

“Grading takes away all the fun from failing. And a huge part of education
is about failure.”  -- Shimon Schocken
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: perl pattern match option 's' (coerce . to include \n)

2012-03-08 Thread will trillich
Greg --

When you're looking for something in particular, it's easy to just look for
that specific thing. As you say, Perl has different definitions of what
"\n" actually translates to depending on platform and context. So rather
than worry about "\n" just have Perl look for what you're actually looking
for. :)

That is, a text file from platform X will have certain line-endings, so you
can use the \n approach. For a binary file that's platform-independent,
seek out dependable codes instead.

E.g. $string =~ /([^\012]+)[\012]([^\012]*)/; Finds everything up to the
first \012 and stuffs that into $1, then the \012, then everything
(including nothing) after that first \012 gets stuffed into $2.

Of course, this is Perl, so
TMTOWTDI
.

Savvy?



On Thu, Mar 8, 2012 at 9:35 AM, Greg Aiken wrote:

> hello all,
>
> i read how one may include 's' at end of a pattern match to essentially
> redefine '.' to include the 'newline character'.
>
> today i found a code fragment whereby someone presents how they extract
> flate encoded streams from pdf files using a regex whereby he is using the
> 's' option.
>
> the problem is that for the particular test pdf file i am trying to
> process, the definition of 'newline' is only (hexOD)
>
> in general, i read that the definition of 'newline' may vary by os, to be
> either of several values:
> (hex0D)(hex0A) windows
> (hexOD) as in the case of this particular pdf file, or
> (hexOA) for some other operating systems
>
> so is there a way one can go one step further to not only use the 's'
> pattern match option, but to then also define what the actual definition of
> 'newline' is supposed to be - so as to guarantee a match of what you are
> intending to match?
>
> i am familiar with 'input line seperator' $/ (which would be used for
> reading input from files), and with 'output line seperator' $\ (which would
> be used for - print "something\n", as in writing to files).  but ive never
> heard of the 'pattern matching seperator' - which i think i would need in
> this case.
>
> thanks in advance for any help in educating me here,
>
> greg
>
>
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>


-- 
"We act as though comfort and luxury were the chief requirements of life,
when all that we need to make us happy is something to be enthusiastic
about." -- Albert Einstein
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: pattern match 'or' operator |

2012-03-08 Thread will trillich
Greg --

The pipe | operator isn't single characters only:

$string =~ /this|that|the other/;

But the character set is:

$string =~ /[abc]/; # matches any a, b or c
$string =~ /[tw]hat/; # matches 'that' or 'what'

What you're looking for is something like this:

$string =~ /\\L(ength)?\b/;

That's going to match
- backslash, followed by
- capital "L", followed by
- optional "ength" (question mark after the parens means it's optional),
followed by
- a word break

So "\Lengthy" would NOT match (there's no word break between h and y)
and "\Len." would NOT match (L must be followed by a word break, or 'ength'
and a word break)
and "Length" would NOT match (there's no leading backslash)
but "\L" would match, as would "\Length".

Regular expressions are very powerful and let you match obtuse patterns of
almost any complexity.

In case it helps, years ago I wrote a SQL-focused intro to regular
expressions, which I found here:
http://markmail.org/message/ivvksx5zihkjmpye . Hope this helps!



On Thu, Mar 8, 2012 at 9:32 AM, Greg Aiken wrote:

> in pdf files evidently there are two different ways  one may specify the
> 'length' operator
>
> sometimes one sees;
> \Length
>
> while at other times, the letter L is sufficient;
> \L
>
> i am wanting to do a pattern match for a line of data in a pdf file where
> i am looking to match EITHER \L or \Length
>
> is there a way that using ONE pattern match I can say achieve something
> like this?
>
> in pseudo code:
>$record =~ /'Length' | 'L'/
> (where the precedence would be towards the first thing matched, in this
> case, 'Length')
>
> the only example ive seen which uses the or operator (|), shows this
> working for a single character only, as in:
>$record =~ /a|b/
>
> ive never seen an example quite like what I would like to do...
>
> if it cant be currently done, perhaps a future enhancement to regex could
> be in order, by adding a new enclosing 'literal delimiter', something like
> this could one day work (forgive me here, im just thinking outside of the
> box - only as i dont know any better);
>
>$record =~ /'Length' | 'L'/
>
> thanks for helping me with my understanding of this.
>
> sincerely,
>
> greg
>
>
>
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>


-- 
"We act as though comfort and luxury were the chief requirements of life,
when all that we need to make us happy is something to be enthusiastic
about." -- Albert Einstein
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: How to push a hash on to a hash of array entries

2011-11-08 Thread will trillich
On Tue, Nov 8, 2011 at 11:20 AM, Paul Rousseau
wrote:

> Here is the Dumper output when I use the code,
>
> push @{$project{$projectno}}, \%days;
>

Right, so $project{$projectno} is an ARRAYREF, and each entry pushed in
this way will be a HASHREF.

Note that other entries may exist in your array before this loop, such as
'SCADA...' and 14 and 3 as shown below.

These are all valid:
print $project{$projectno}[0]; # SCADA...
print $project{$projectno}[1]; # 14
print $project{$projectno}[2]; # 3
print $project{$projectno}[3]{'6'}[0]; # 4.00
print $project{$projectno}[4]{'3'}[0]; # 6.00
etc.

$VAR1 = {
>   '2011-0101' => [
>
 # the first three here are throwing you off
your game:

>'SCADA Host Re-evaluation Project',
>14,
>3,
>{
>  '6' => [
>   '4.00',
>   ''
> ],
>  '3' => [
>   '6.00',
>   ''
> ],
>  '5' => [
>   '4.00',
>   ''
> ]
>}
>  ]
> };
>
>
> When I execute the line,
>
> print Dumper \%{$project{$projectno}[2]};
>
> I still get the error,
>
>
> Can't use string ("3") as a HASH ref while "strict refs" in use at
> c:\images\mactimesheet.pl line 40
> 1,  line 1.
>
> I will continue to experiment with the semantics. I believe I am close.
>
> Paul
>
>
>
>
>
>  > Date: Tue, 8 Nov 2011 02:26:17 +0200
> > Subject: Re: How to push a hash on to a hash of array entries
> > From: szab...@gmail.com
> > To: paulrousseau...@hotmail.com
> > CC: perl-win32-users@listserv.activestate.com
>
> >
> > Hi Paul,
> >
> > there are a couple of issues I could see in the code you sent,
> > let me point out some of them and hope those will help.
> >
> > In general I'd recommend using the Dumper function of Data::Dumper
> > to check what kind of data structure you got.
> >
> >
> >
> > On Tue, Nov 8, 2011 at 1:41 AM, Paul Rousseau
> >  wrote:
> > > Hello Perl Community,
> > >
> > >I want to build a complex hash.
> > >
> > > I want my hash structure to look like this:
> > >
> > > # %project = ( => [,
> > > #   ,
> > > #   %days1 = ( =>
> > > [,],
> > > #y> =>
> > > [, ]
> > > #  )
> > > # ],
> > > #  ,
> > > #   ,
> > > #   %days2 = ( =>
> > > [,],
> > > #y> =>
> > > [, ]
> > > #  )
> > > # ]
> > > # )
> > >
> > > I am having trouble building up and populating the individual %days
> hash.
> > >
> > > Here is what I have so far.
> > >
> > > use strict;
> >
> > I'd recommend adding "use warnings;" as well.
> >
> > >
> > > my (
> > >   %project,
> > >   $projectno, $desc,
> > >   $day,
> > >   %days,
> > >   $i
> > >  );
> > >
> > > $projectno = "12345";
> > > "$desc = "testing first project";
> > >
> > > $project{$projectno} = [$desc, "0"];   # zero hours
> > >
> > > #later on, my code reads in some records such as
> > >
> > > # 3, 12, "painted a room"
> > > # 5, 6, "added a chair"
> > > # 14, 2, "made some calls"
> > >
> > > # for, say, project "12345"
> > >
> > > For my first test, I populated a smaller hash called %days.
> > >
> > > for ($i = 1; $i <=3; $i++)
> > >{
> > > ($day, $hour, $text) = split (',', );
> > >  $days{$day} = ($hour, $text);
> > >}
> > >
> >
> > If I am not mistaken you want to pass an array reference there
> > and not an array so need square brackets:
> >
> > $days{$day} = [$hour, $text];
> >
> > Try this:
> > use Data::Dumper qw(Dumper);
> > print Dumper \%days;
> >
> >
> >
> > > #
> > > # now that I have finished populating a smaller hash, I want to copy
> the
> > > hash on to the bigger hash.
> > > #
> > >
> > > push @{$project{$projectno}}, %days;
> >
> > In this case perl will flatten the hash and you will push all the keys
> > and values of it to the array.
> > Try printing out the result with the Dumper.
> >
> > I am almost sure you will want to write:
> >
> > push @{$project{$projectno}}, \%days;
> >
> > See the back-slash in-front of the hash.
> >
> >
> > regards
> > Gabor
> >
> > --
> > Gabor S

Re: How to split up a string with carriage returns into an array

2011-11-04 Thread will trillich
On Fri, Nov 4, 2011 at 1:15 PM,  wrote:

> Perl should handle the \r\n part for you  - "\n" is normally a match for
> whatever your OS's end of line marker is.
>

But just in case you're on *nix and processing a Windo~1 file, split(
/[\r\n]+/, $msg ) is reasonably bullet-proof for breaking a string at
line-break. Note that it will treat multiple blank lines as a single
line-break.

-- 
"The very nucleus of Character: to do what you know you should do, when you
don't want to do it." Stephen Covey
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: How to Extract a Date from a File

2011-11-02 Thread will trillich
How about something like this:

  next unless m:(\d\d\d\d)/(\d\d)/(\d\d):;
  $start_date = "$1$2$3";


On Wed, Nov 2, 2011 at 4:07 PM, Paul Rousseau
wrote:

>  Hello Perl folks,
>
>
> I would like to know if there is an eloquent way of extracting a date
> string from a file.
>
> My code goes like this:
>
>open (INFILE, "<$sourcedir\\$filename") || die "Can not open
> $sourcedir\\$filename $!\n";
>@filecontents = ;
>close INFILE;
>@filecontents = map {chomp; $_} @filecontents;
>
> #
> # Within the file contents, look for the text, CurrentWeekLabel
> #
> # Here is a text sample.
> #
> #   
> # id="CurrentWeekLabel">Week Of:  style="font-weight:bold;">2011/10/29 style="font-weight:bold;"> -  style="font-weight:bold;">2011/11/04
> # id="PreviousWeekLinkButton" class="LinkButton"
> href="javascript:OnPreviousWeekLinkButtonClick ()"
> href="javascript:__doPostBack('PreviousWeekLinkButton','')">Prev id="Label20"> |  onclick="SelectWeekButtonClick('PopupCalendar1', 'SelectWeekLinkButton');
> return false;" id="SelectWeekLinkButton" class="LinkButton"
> href="javascript:__doPostBack('SelectWeekLinkButton','')">Select
> Week |  class="LinkButton" href="javascript:OnNextWeekLinkButtonClick ()"
> href="javascript:__doPostBack('NextWeekLinkButton','')">Next
> #
> #   
> #
> # Obtain the year, month and day following the text, StartWeekLabel
> #
>   @ans = grep (/StartWeekLabel.+\>(\d{4})\/(\d{2})\/(\d{2})\<\/span/si,
> @filecontents);
> #
> # Build the start date from the matches.
> #
> $start_date = $1 . $2 . $3
>
> I was wondering if there was a neat way to avoid using @ans as a temporary
> variable, and extract the "2011/10/29" straight into $start_date so that
> $start_date = "20111029"
>
> Thank you
>
> Paul Rousseau
> 403 776 4293
>
>
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>


-- 
"The very nucleus of Character: to do what you know you should do, when you
don't want to do it." Stephen Covey
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: Help with file redirect

2011-07-05 Thread will trillich
I haven't tested this, but here's a similar problem to yours--maybe these
solutions will work for you:

http://www.perlmonks.org/?node_id=4913


On Tue, Jul 5, 2011 at 3:43 PM, Barry Brevik wrote:

> I am writing an app that has a lot of screen output which it writes to
> STDERR.
>
> The screen output is copious, but I need it right now for debugging; I
> can get rid of it later.
>
> My question is if it is possible to write to STDERR and a named file at
> the same time? I'd rather not go through the code and change every print
> statement.
>
> Barry Brevik
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>



-- 
"The Fed is still under the assumption all they have to do to revive an
economy is blow a new bubble" -- Josh Rosner. Amen!
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: how to best convert an array containing hexadecimal values to ascii value?

2010-11-23 Thread will trillich
Or if you want the characters themselves:

@result = map { chr( hex ) } @source;

Or as a solid string:

$s = join '', map { chr( hex ) } @source;


On Tue, Nov 23, 2010 at 3:47 PM, will trillich
wrote:

> Dude! This one is really easy:
>
> print hex("ff"); # 255!
>
> so @result = map{ hex } @source;
>
> Mwa ha ha!
>
>
> On Tue, Nov 23, 2010 at 3:44 PM, Greg Aiken wrote:
>
>>  if one dumps a windows registry section using regedit (to *.reg format)
>>
>>
>>
>> the reg_sz values are listed in the following format (heres a code
>> fragment)
>>
>>
>>
>>
>> "\\DosDevices\\E:"=hex:5c,00,3f,00,3f,00,5c,00,53,00,43,00,53,00,49,00,23,00,\
>>
>>
>> 43,00,64,00,52,00,6f,00,6d,00,26,00,56,00,65,00,6e,00,5f,00,45,00,5a,00,35,\
>>
>>
>> 00,33,00,35,00,32,00,58,00,26,00,50,00,72,00,6f,00,64,00,5f,00,56,00,54,00,\
>>
>>
>> 59,00,35,00,32,00,37,00,4f,00,26,00,52,00,65,00,76,00,5f,00,32,00,2e,00,30,\
>>
>>
>> 00,42,00,23,00,35,00,26,00,33,00,36,00,65,00,35,00,39,00,37,00,32,00,26,00,\
>>
>>
>> 30,00,26,00,30,00,30,00,30,00,23,00,7b,00,35,00,33,00,66,00,35,00,36,00,33,\
>>
>>
>> 00,30,00,64,00,2d,00,62,00,36,00,62,00,66,00,2d,00,31,00,31,00,64,00,30,00,\
>>
>>
>> 2d,00,39,00,34,00,66,00,32,00,2d,00,30,00,30,00,61,00,30,00,63,00,39,00,31,\
>>
>>   00,65,00,66,00,62,00,38,00,62,00,7d,00
>>
>>
>>
>> ive already got code that parses this info.
>>
>>
>>
>> ive removed the trailing \(backslash)newline(space)(space) from the data
>> block so im left with a scalar containing hexadecimal values separated with
>> a comma.
>>
>>
>>
>> ive then split this long scaler on the ‘,’ (comma) to yield an array
>> containing the hex values.
>>
>>
>>
>> my problem here is that I don’t know the easiest ‘built-in’ way to convert
>> this list of hex values to ascii values (ascii values as in the ascii
>> character set for printing in human readable letters).  as in the ‘char’
>> column of this table
>> http://www.hobbyprojects.com/ascii-table/images/ascii-table1.gif
>>
>>
>>
>> I know chr(decimal value) will do such a conversion.  but my values in the
>> array are not in decimal value format.
>>
>>
>>
>> and im kind of lost with pack…  ive unsuccessfully tried…
>>
>>
>>
>> $ascii_string = pack(“H*”, @hex_array) and
>>
>> $ascii_string = pack(“h*”, @hex_array)
>>
>>
>>
>> but neither yields the proper output.
>>
>>
>>
>> I know I could write an ultra low level code that directly converts each
>> hex byte to decimal, then call chr with the decimal value, but certainly
>> that’s ‘too much work’ in perl.
>>
>>
>>
>> any help would be appreciated.
>>
>>
>>
>> it would be as if were starting with
>>
>>
>>
>> @hex_array = (‘5c’,’00’,’3f’,’00’,’3f’,’00’,’5c’,’00’,’53’,’00’,…);
>>
>> ___
>> Perl-Win32-Users mailing list
>> Perl-Win32-Users@listserv.ActiveState.com
>> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>>
>>
>
>
> --
> Failure is not important. How you overcome it, is.
> -- Nick Vujicic
>



-- 
Failure is not important. How you overcome it, is.
-- Nick Vujicic
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: how to best convert an array containing hexadecimal values to ascii value?

2010-11-23 Thread will trillich
Dude! This one is really easy:

print hex("ff"); # 255!

so @result = map{ hex } @source;

Mwa ha ha!


On Tue, Nov 23, 2010 at 3:44 PM, Greg Aiken wrote:

>  if one dumps a windows registry section using regedit (to *.reg format)
>
>
>
> the reg_sz values are listed in the following format (heres a code
> fragment)
>
>
>
>
> "\\DosDevices\\E:"=hex:5c,00,3f,00,3f,00,5c,00,53,00,43,00,53,00,49,00,23,00,\
>
>
> 43,00,64,00,52,00,6f,00,6d,00,26,00,56,00,65,00,6e,00,5f,00,45,00,5a,00,35,\
>
>
> 00,33,00,35,00,32,00,58,00,26,00,50,00,72,00,6f,00,64,00,5f,00,56,00,54,00,\
>
>
> 59,00,35,00,32,00,37,00,4f,00,26,00,52,00,65,00,76,00,5f,00,32,00,2e,00,30,\
>
>
> 00,42,00,23,00,35,00,26,00,33,00,36,00,65,00,35,00,39,00,37,00,32,00,26,00,\
>
>
> 30,00,26,00,30,00,30,00,30,00,23,00,7b,00,35,00,33,00,66,00,35,00,36,00,33,\
>
>
> 00,30,00,64,00,2d,00,62,00,36,00,62,00,66,00,2d,00,31,00,31,00,64,00,30,00,\
>
>
> 2d,00,39,00,34,00,66,00,32,00,2d,00,30,00,30,00,61,00,30,00,63,00,39,00,31,\
>
>   00,65,00,66,00,62,00,38,00,62,00,7d,00
>
>
>
> ive already got code that parses this info.
>
>
>
> ive removed the trailing \(backslash)newline(space)(space) from the data
> block so im left with a scalar containing hexadecimal values separated with
> a comma.
>
>
>
> ive then split this long scaler on the ‘,’ (comma) to yield an array
> containing the hex values.
>
>
>
> my problem here is that I don’t know the easiest ‘built-in’ way to convert
> this list of hex values to ascii values (ascii values as in the ascii
> character set for printing in human readable letters).  as in the ‘char’
> column of this table
> http://www.hobbyprojects.com/ascii-table/images/ascii-table1.gif
>
>
>
> I know chr(decimal value) will do such a conversion.  but my values in the
> array are not in decimal value format.
>
>
>
> and im kind of lost with pack…  ive unsuccessfully tried…
>
>
>
> $ascii_string = pack(“H*”, @hex_array) and
>
> $ascii_string = pack(“h*”, @hex_array)
>
>
>
> but neither yields the proper output.
>
>
>
> I know I could write an ultra low level code that directly converts each
> hex byte to decimal, then call chr with the decimal value, but certainly
> that’s ‘too much work’ in perl.
>
>
>
> any help would be appreciated.
>
>
>
> it would be as if were starting with
>
>
>
> @hex_array = (‘5c’,’00’,’3f’,’00’,’3f’,’00’,’5c’,’00’,’53’,’00’,…);
>
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>


-- 
Failure is not important. How you overcome it, is.
-- Nick Vujicic
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: lame question "\\\\.\\pipe\\pipename" vs '\\.\pipe\pipename'

2010-10-20 Thread will trillich
Here's my take:

print 'it\'s time \\ to go';

The backslash can quote the single-quote, and hence another backslash as
well for completeness, within a single-quoted string.



On Wed, Oct 20, 2010 at 12:09 PM, Greg Aiken wrote:

>  forgive my ignorance here, but I thought single quoted, or apostrophized
> [however you call this character] (‘) text strings were supposed to be
> interpreted by perl in an unaltered manner.
>
>
>
> sample code, indicating how to reference a named pipe in the Win32::Pipe
> module, shows something like this…
>
>
>
> “.\\pipe\\pipename” (note enclosed in quotes)
>
>
>
> I thought the excessive quantities of backslashes seemed silly, so I
> instead used single quotes and tried…
>
>
>
> ‘\\.\pipe\pipename’ (note enclosed in apostrophies)
>
>
>
> only to find that my client pipe program did not work.
>
>
>
> I then did a simple test print program;
>
> print ‘\\.\pipe\pipename’;
>
>
>
> and I was surprised to see what actually printed to the screen was instead;
>
> \.\pipe\pipename (note the first \ is not shown in output!)
>
>
>
> this explained why my client pipe program was working…
>
>
>
> but it left me scratching my head to ask, “why is the backslash character
> being interpreted as a special perl operator when it is found within
> apostrophies?”
>
>
>
> I thought that only happened when the backslash is found within quotes,
> such as (print “\x43”), which should print a capital C
>
>
>
> thanks in advance to anyone who can explain this to me.
>
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
>
>


-- 
Failure is not important. How you overcome it, is.
-- Nick Vujicic
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs