[22803] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5024 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 22 09:05:49 2003

Date: Thu, 22 May 2003 06:05:15 -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           Thu, 22 May 2003     Volume: 10 Number: 5024

Today's topics:
    Re: Alarm + System zombies (Villy Kruse)
        Array and Hash headache <abertron@btconnect.com>
    Re: Array and Hash headache <steve@uptime.orgNo.ukSpam>
    Re: Array and Hash headache <goedicke@goedsole.com>
    Re: Array and Hash headache (Tad McClellan)
    Re: Array and Hash headache <abertron@btconnect.com>
    Re: Can I save my sourcecode from the Perl debugger? (Sara)
    Re: DBI - 0 is not being treated as False ? (Veky)
    Re: finding "mailto:" strings in html files (Netware60)
    Re: FORM/CGI: submit a file <nobody@dev.null>
    Re: help me with these guts (Sara)
        how to discard output from a FH? <ah@siol.net>
        Scalar String concatination not working <subs.nntp.wfitzgerald@crtman.com>
    Re: Scalar String concatination not working <g4rry_short@zw4llet.com>
    Re: Scalar String concatination not working <subs.nntp.wfitzgerald@crtman.com>
    Re: Scalar String concatination not working <abigail@abigail.nl>
    Re: Scalar String concatination not working <jamarier@yahoo.es>
    Re: Scalar String concatination not working <nobull@mail.com>
    Re: Scalar String concatination not working (Tad McClellan)
    Re: Shutting Down Windoze (Helgi Briem)
    Re: Shutting Down Windoze <abigail@abigail.nl>
    Re: Shutting Down Windoze (Helgi Briem)
    Re: Software Engineer - Verilog/Perl - EDA tool develop <nobody@dev.null>
        Software Engineer - Verilog/Perl - EDA tool development <topjob@ecmsel.co.uk>
        Win32::OLE (Graham Smith)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 22 May 2003 11:50:57 GMT
From: vek@station02.ohout.pharmapartners.nl (Villy Kruse)
Subject: Re: Alarm + System zombies
Message-Id: <slrnbcped1.i1p.vek@station02.ohout.pharmapartners.nl>

On 21 May 2003 06:13:55 -0700,
    Vinicio Tavares <vtmcs@terra.com.br> wrote:


>I have this code, it creates zombies, how can I solve this problem? Thanks.
>
>...
>eval {
>    local $SIG {ALRM} = sub { die "..." };
>    alarm $timx;
>    system "...";
>    alarm 0;
>}
>...
>


Don't try to abort the system function.  It won't have a chance to
take care of the zombie that is created possible long after the alarm
timed out.


Villy


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

Date: Thu, 22 May 2003 13:29:23 +0000
From: Gary Mayor <abertron@btconnect.com>
Subject: Array and Hash headache
Message-Id: <4n3za.2321$Y57.66762@newsfep1-win.server.ntli.net>

Hi,
This is my first post on this newsgroup so please accuse me if it's in 
the wrong place.
Basically i'm trying to put a string into a hash but the string won't go 
in. Here's the hash.

$data1 = "one";
$data2 = "two";
$data3 = "three";
$data4 = "four";

%category = (
category01 => '$data1',
category02 => '$data2',
category03 => '$data3',
category04 => '$data4',
);

print $category{category01};
print $category{category02};
print $category{category03};
print $category{category04};

I've gone through the perl cookbook and looked on deja.com but found 
nothing and this exact problem. The output comes out like this,

$data1

$data2

$data3

$data4

I hoped it would be

one

two

three

four

So does anyone have the correct syntax for putting a string into a array.

Thanks

Gary Mayor



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

Date: Thu, 22 May 2003 13:33:07 +0100
From: Stephen Hildrey <steve@uptime.orgNo.ukSpam>
Subject: Re: Array and Hash headache
Message-Id: <1053606787.231.0@damia.uk.clara.net>

In article <4n3za.2321$Y57.66762@newsfep1-win.server.ntli.net>,
Gary Mayor wrote:
> Hi,
> This is my first post on this newsgroup so please accuse me if it's in 
> the wrong place.
> Basically i'm trying to put a string into a hash but the string won't go 
> in. Here's the hash.
> 
> $data1 = "one";
> $data2 = "two";
> $data3 = "three";
> $data4 = "four";
> 
> %category = (
> category01 => '$data1',
> category02 => '$data2',
> category03 => '$data3',
> category04 => '$data4',
> );
> 
> print $category{category01};
> print $category{category02};
> print $category{category03};
> print $category{category04};
> 
> I've gone through the perl cookbook and looked on deja.com but found 
> nothing and this exact problem. The output comes out like this,
> 
> $data1
> 
> $data2
> 
> $data3
> 
> $data4
> 
> I hoped it would be
> 
> one
> 
> two
> 
> three
> 
> four

Variables are not interpolated within single quotes, so you probably
meant to say:

    $data1 = "one";
    $data2 = "two";
    $data3 = "three";
    $data4 = "four";

    %category = (
        category01 => $data1,
        category02 => $data2,
        category03 => $data3,
        category04 => $data4,
    );

Note, though, that you still cannot be guaranteed to get:

    one
    two
    three
    four

if you're just iterating over the hash using keys() - the ordering
within the hash is not predictable.

Regards,
Steve


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

Date: Thu, 22 May 2003 12:35:50 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: Array and Hash headache
Message-Id: <m37k8jf9b3.fsf@mail.goedsole.com>

Dear Gary - 

Gary Mayor <abertron@btconnect.com> writes:

> %category = (
> category01 => '$data1',
> category02 => '$data2',
> category03 => '$data3',
> category04 => '$data4',
> );

Use double-quotes instead of single quotes.

     Yours -      Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
                          http://www.goedsole.com:8080      
============================================================

          Lest we forget:

Goedicke: "Godlike"

		- The Microsoft Spelling Dictionary


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

Date: Thu, 22 May 2003 07:46:42 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Array and Hash headache
Message-Id: <slrnbcphli.2k8.tadmc@magna.augustmail.com>

William Goedicke <goedicke@goedsole.com> wrote:
> Gary Mayor <abertron@btconnect.com> writes:
> 
>> %category = (
>> category01 => '$data1',

> Use double-quotes instead of single quotes.


No, use NO quotes instead of single quotes.


From the Perl FAQ:

   What's wrong with always quoting "$vars"?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 22 May 2003 13:52:09 +0000
From: Gary Mayor <abertron@btconnect.com>
Subject: Re: Array and Hash headache
Message-Id: <pI3za.2361$Y57.71948@newsfep1-win.server.ntli.net>

Thanks people get rid of the quotes sorted


Tad McClellan wrote:
> William Goedicke <goedicke@goedsole.com> wrote:
> 
>>Gary Mayor <abertron@btconnect.com> writes:
>>
>>
>>>%category = (
>>>category01 => '$data1',
> 
> 
>>Use double-quotes instead of single quotes.
> 
> 
> 
> No, use NO quotes instead of single quotes.
> 
> 
> From the Perl FAQ:
> 
>    What's wrong with always quoting "$vars"?
> 
> 



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

Date: 22 May 2003 05:32:39 -0700
From: genericax@hotmail.com (Sara)
Subject: Re: Can I save my sourcecode from the Perl debugger?
Message-Id: <776e0325.0305220432.59be5381@posting.google.com>

genericax@hotmail.com (Sara) wrote in message news:<776e0325.0305210944.24c8ce28@posting.google.com>...
> Ack- I have a debug session open with my current sources loaded, but
> in the meantime a sysadmin clobbered all of my sourcecode. Is there
> any way to save the sources from the debugger? I looked at debug help
> and searched this group I don't see it.
> 
> I know I could list the whole script and save it but is there a way to
> export it to a file?
> 
> Thanks,
> Gx

Well it wasn't pretty, but I did "f" to go to each module, then listed
all of the lines in the module to the terminal, then cut and pasted
into vi and saved it.

Only problem was that it also included line-numbers and varying
numbers of leading spaces and occasional ":"s after the number. A
quick Perlscript fixed that and we're back in business.

If there is an easier way please advise me. I didn't see any in help
of in newsgroups..

And if there ISN'T an easier way- hey debug dudes, this is a useful
thing to be able to do!

By the way I also tried to redirect the listing to a file, but the ">"
seemed to be ignored, and I tried to pipe to vi as well.

Gx


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

Date: Thu, 22 May 2003 10:06:06 +0000 (UTC)
From: veky@cromath.math.hr (Veky)
Subject: Re: DBI - 0 is not being treated as False ?
Message-Id: <bai7ee$1ea$1@bagan.srce.hr>

Dok je Veky citao comp.lang.perl.misc, pod PIDom 5393 (290766 off, 0 to go...),
primijetio je kreaturu zvanu "Kasp" <kasp@epatra.com>,
ispod cijih su prstiju izasle (izmedu ostalih) sljedece rijeci:

|"DBI plays a magic trick so that the value it turns is true even when it is
|0."
|[source = http://www.perl.com/pub/a/1999/10/DBI.html ]
|Can some one please explain how this can be done?
|I find this bizarre, because 0 is false in Perl.

Hint: "0 but true". Find it in perldoc.

-- 
\#{%	Sad gradi svoj grad iz snova... znaj da mozes i znaj da znas...


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

Date: 22 May 2003 03:47:38 -0700
From: clos@trentu.ca (Netware60)
Subject: Re: finding "mailto:" strings in html files
Message-Id: <55964b31.0305220247.eb2ab8e@posting.google.com>

thanks for the code... but when I run it i don't get any output  when
I know there should be some. Any suggestions as to what is going
wrong?  Thanks.

veky@cromath.math.hr (Veky) wrote in message news:<bag0lk$dgh$1@bagan.srce.hr>..
> Dok je Veky citao comp.lang.perl.misc, pod PIDom 22953 (290622 off, 5 to go...),
> primijetio je kreaturu zvanu clos@trentu.ca (Netware60),
> ispod cijih su prstiju izasle (izmedu ostalih) sljedece rijeci:
> 
> |I need to search thru a list of html text files and find and extract
> |out all the occurrences of the word "mailto:" followed by an email
> |address . So something like "" or "mailto: juser@host.domain.com". I
> |just need to create a report of all the mailto occurrences contained
> |in my file list.
> |I'd like my report to like this if possible:
> |
> |mailto:juser@host.domain.com
> |mailto:juser@hosta.domain.com
> |mailto:juser2@hostb.domain.com
> |mailto:juser3@hostc.domain.com
> 
> @ARGV=<*.html>;while(<>){
> 	push@spamlist,@f if@f=/"(mailto:[\w@.])"/g
> };print join"\n",sort@spamlist


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

Date: Thu, 22 May 2003 12:08:21 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: FORM/CGI: submit a file
Message-Id: <3ECCBD9F.3010507@dev.null>



Mael Guillemot wrote:

> Hi everybody!
> 
> I am trying to do a dialog box button for directory browsing on local
> disk using POST method from the HTML FORM element. I want the user to
> submit a file. Does anybody knows how to make it?
> 
> Do I need a library such that libwww-perl to do that?
> 
> thanks,
> 
> Maël
> 


Use the CGI.pm module, which likely comes bundled with your Perl 
distribution. Typing

perldoc CGI

at the command prompt will explain the details to you. Read the part 
about "Creating a file upload field."




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

Date: 22 May 2003 05:43:27 -0700
From: genericax@hotmail.com (Sara)
Subject: Re: help me with these guts
Message-Id: <776e0325.0305220443.8ccbdc8@posting.google.com>

Eric Wilhelm <ericw@nospam.ku.edu> wrote in message news:<pan.2003.05.21.22.25.35.162517.5987@nospam.ku.edu>...
> I'm trying to return a string to a reference from a function built using
> swig.

(Do you mean a reference to a string?)


> 
> I think I've narrowed it down to sv_setpv and I can't really see what I'm
> supposed to do here.
> 
> %typemap(perl5,in) char * blob (char * text){
> 	SV* tempsv;
> 	if ( !SvROK($source)) {
> 		croak("expected a reference\n");
> 	}

how about the ever-so-much more digestable...
   croak "expected a reference\n" unless SvROK($source);


   
> 	tempsv = SvRV($source);
> 	text = SvPV(tempsv,na);
>     	$target = text;
> }
> %typemap(perl5,argout) char * blob {
>     SV *tempsv;
> 	STRLEN length;
>     if (SvOK($arg)) {
>         tempsv = SvRV($arg);
Sorry I don't understand your syntax- char * ? Is this Perl?




>         if ($source == NULL) { 
better written
      unless ($source)


>             sv_setsv(tempsv, &PL_sv_undef);
>         } else {
> 	    printf("typemap got back:  %s\n", $source);
> 	    sv_setpv(tempsv, $source);
>             // chokes on line above
>         }
>     }
> }
> 
> int dumbfunc(char *blob){
> 	printf("read %s\n", blob);
> 	sprintf(blob, "output text is really long");
> 	}
> 
> This causes a segfault where sv_setpv tries to load the variable, but I
> can't seem to get SvGROW to work either.
> 
> Anyone have an idea of how to do this?
> 
> Thanks,
> Eric


Not sure exactly what you're trying to do, but on the surface it looks
like you're a c-programmer who is trying to make his Perl look as much
like c as you can. I'm not saying that's necessarily a bad thing, but
I've looked at a LOT of Perl code good and bad in this group, and
generally the "good code" has little resemblemce to c.

Perl has it's own idomatic optima, as does c, but they're different.

Perhaps a visit to Randall's "Idomatic Perl" would be helpful.

-Gx


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

Date: Thu, 22 May 2003 11:05:35 GMT
From: Andrej Hocevar <ah@siol.net>
Subject: how to discard output from a FH?
Message-Id: <slrnbcpbs2.334.ah@sonet.utopija.linux>

Hello,
I'm trying to get rid of some output from a FH attached to a socket. 

If I send a command to it, it produces some output. Now if I want to
store it, it's easy. But what to do if I dont't need it? The problem
is that the output from the previous command will still remain there
upon trying to collect the output produced by the next one. Or, say,
I may only need part of the output which I can easily find, but that
won't make the remaining lines go away. Thus if there were many, the
processing will take a long time even if the desired data came early.

Of course, I could store every unneeded line in a temporary variable
but it doesn't sound as a good solution, besides it would still have
to go through every line of the output.

So how do I proceed?

Thanks,

    andrej

-- 
echo ${girl_name} > /etc/dumpdates


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

Date: Thu, 22 May 2003 10:29:49 GMT
From: "Warrick FitzGerald" <subs.nntp.wfitzgerald@crtman.com>
Subject: Scalar String concatination not working
Message-Id: <xE1za.2585$Pz3.1167449@news4.srv.hcvlny.cv.net>

Hi All,

I am trying to derive two numbers and create an output that looks like
this:

<FirstNumber> <NameOfFirstNumber>
<SecondNumber> <NameOfSecondNumber>

The first number I get from a web page using LWP::Simple
The second from the last line in a text file (Which is always being
appended to).

For some unknown reson printing the first line seems to be giving me a
really hard time.

Line 7: print scalar $1." Test \n"; looses the value of $1 as soon as I
append any string to it.

If I try 
print $1."\n"; I get the number outputted to screen

if I try 
print $1."zz\n"; I do not get the number

I'm sure I am missing some fundimetal concept in perl, and would really
appreciate someone helping me out.

Thanks
Warrick

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

#!/usr/bin/perl -w
#
use LWP::Simple;

$CountPage = get "http://SomeURL.com";
$CountPage =~ m/EventCount=([^<].*)/;
print scalar $1." Test \n";

$LastLine="";
open(MyFile,"test");
foreach (<MyFile>){
        chomp;
        $LastLine = $_;
}
close MyFile;
print $LastLine." LastLine\n";

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


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

Date: Thu, 22 May 2003 11:39:38 +0000
From: Garry Short <g4rry_short@zw4llet.com>
Subject: Re: Scalar String concatination not working
Message-Id: <bai9gr$24h$1$830fa79f@news.demon.co.uk>

Warrick FitzGerald wrote:

<SNIP>
> print $LastLine." LastLine\n";

print "$LastLine LastLine\n";

In other words, just put the variable in quotes! (For the scalar one, do it
on two lines if you have to:
$x = scalar $1;
print "$x Test\n";
)

HTH,

Garry




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

Date: Thu, 22 May 2003 10:57:01 GMT
From: "Warrick FitzGerald" <subs.nntp.wfitzgerald@crtman.com>
Subject: Re: Scalar String concatination not working
Message-Id: <122za.2696$Pz3.1228283@news4.srv.hcvlny.cv.net>


> do it on two lines if you have to:
> $x = scalar $1;
> print "$x Test\n";
> )


Thanks for the idea Gary,but it did not seem to work either. Please see
my changes:

#!/usr/bin/perl -w
#
use LWP::Simple;

$CountPage = get "http://SomeURL.com";
$CountPage =~ m/EventCount=([^<].*)/;
$x = scalar $1;
print "$x zz\n";

$LastLine="";
open(MyFile,"test");
foreach (<MyFile>){
        chomp;
        $LastLine = $_;
}
close MyFile;
print $LastLine." LastLine\n";

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

Generates the following outout:

root@mail /home/cricket/scripts # ./GetIndexServerStats.pl
 zz
456 LastLine


Thanks
Warrick


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

Date: 22 May 2003 11:00:02 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Scalar String concatination not working
Message-Id: <slrnbcpbdi.kuj.abigail@alexandra.abigail.nl>

Warrick FitzGerald (subs.nntp.wfitzgerald@crtman.com) wrote on MMMDLI
September MCMXCIII in <URL:news:xE1za.2585$Pz3.1167449@news4.srv.hcvlny.cv.net>:
^^  Hi All,
^^  
^^  I am trying to derive two numbers and create an output that looks like
^^  this:
^^  
^^ <FirstNumber> <NameOfFirstNumber>
^^ <SecondNumber> <NameOfSecondNumber>
^^  
^^  The first number I get from a web page using LWP::Simple
^^  The second from the last line in a text file (Which is always being
^^  appended to).
^^  
^^  For some unknown reson printing the first line seems to be giving me a
^^  really hard time.
^^  
^^  Line 7: print scalar $1." Test \n"; looses the value of $1 as soon as I
^^  append any string to it.

I cannot reproduce that. It works fine for me.

^^  
^^  If I try 
^^  print $1."\n"; I get the number outputted to screen
^^  
^^  if I try 
^^  print $1."zz\n"; I do not get the number
^^  
^^  I'm sure I am missing some fundimetal concept in perl, and would really
^^  appreciate someone helping me out.
^^  
^^  Thanks
^^  Warrick
^^  
^^  --------------------------------------------------------
^^  
^^  #!/usr/bin/perl -w
^^  #
^^  use LWP::Simple;
^^  
^^  $CountPage = get "http://SomeURL.com";
^^  $CountPage =~ m/EventCount=([^<].*)/;
^^  print scalar $1." Test \n";

You are making some bold assumptions here. What if the get fails?
What if the match fails? In both cases, $1 will be undefined.
And what's with the 'scalar'?

^^  $LastLine="";
^^  open(MyFile,"test");

What if the open fails?

^^  foreach (<MyFile>){
^^          chomp;
^^          $LastLine = $_;
^^  }
^^  close MyFile;
^^  print $LastLine." LastLine\n";


Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


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

Date: Thu, 22 May 2003 11:43:50 +0000 (UTC)
From: Javier M Mora <jamarier@yahoo.es>
Subject: Re: Scalar String concatination not working
Message-Id: <baid5m$5c2$1@nsnmpen2-gest.nuria.telefonica-data.net>

En el artículo <122za.2696$Pz3.1228283@news4.srv.hcvlny.cv.net>, 
	Warrick FitzGerald escribió:
> 
>> do it on two lines if you have to:
>> $x = scalar $1;
>> print "$x Test\n";
>> )
> 
> 
> Thanks for the idea Gary,but it did not seem to work either. Please see
> my changes:
> 
> #!/usr/bin/perl -w
> #
> use LWP::Simple;
> 
> $CountPage = get "http://SomeURL.com";
> $CountPage =~ m/EventCount=([^<].*)/;
> $x = scalar $1;
> print "$x zz\n";
> 
> $LastLine="";
> open(MyFile,"test");
> foreach (<MyFile>){
>         chomp;
>         $LastLine = $_;
> }
> close MyFile;
> print $LastLine." LastLine\n";
> 
> --------------------
> 
> Generates the following outout:
> 
> root@mail /home/cricket/scripts # ./GetIndexServerStats.pl
>  zz
> 456 LastLine
> 
> 
> Thanks
> Warrick

The problem isn't the concatenation. There are two  problems here.

* Why do you write '$x= scalar $1' if $1 is scalar?

* $1 is undefined because the regex is false. $CountPage don't match
 with /EventCount=([^<].*)/

 you must verify $1 have apropiated value.

Yours Javier M Mora.


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

Date: 22 May 2003 13:09:28 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Scalar String concatination not working
Message-Id: <u9smr718uf.fsf@wcl-l.bham.ac.uk>

"Warrick FitzGerald" <subs.nntp.wfitzgerald@crtman.com> writes:

> If I try 
> print $1."\n"; I get the number outputted to screen
> 
> if I try 
> print $1."zz\n"; I do not get the number

I do not believe you.

> $CountPage = get "http://SomeURL.com";
> $CountPage =~ m/EventCount=([^<].*)/;
> print scalar $1." Test \n";

I cannot get your test case to work, there does not appear to be
anything listening on SomeURL.com:http

$ telnet SomeURL.com http
Trying 24.118.117.81...
telnet: connect to address 24.118.117.81: Connection refused

You should always try to include a _real_ test case that we can
_actually_ run on our own machines and see it work.

Random shot in the dark...

Try this rather simpler test case:

"42\r" =~ /(.*)/; # $1="42\r"
print $1."\n"; # print 42
print $1."zz\n"; # print 42 then overwrite it with zz

Does that explain what you are seeing?

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Thu, 22 May 2003 07:31:29 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Scalar String concatination not working
Message-Id: <slrnbcpgp1.2iv.tadmc@magna.augustmail.com>

Warrick FitzGerald <subs.nntp.wfitzgerald@crtman.com> wrote:

> For some unknown reson printing the first line seems to be giving me a
> really hard time.


You are looking for the problem in the wrong place.

print() is not the problem.


> Line 7: print scalar $1." Test \n"; looses the value of $1 as soon as I
> append any string to it.


That is not possible.

The values of the dollar-digit variables change _only_ when
there is a _successful_ match.


> #!/usr/bin/perl -w


Are you getting "uninitialized value" warnings?


> $CountPage = get "http://SomeURL.com";


What will happen if the get() fails?

Are you sure it is succeeding?


> $CountPage =~ m/EventCount=([^<].*)/;


You have not tested if the match succeeded or not, so you cannot
know if $1 got set or not.

You have a strange pattern. It will match whenever the character
following the equals sign is not an angle bracket.

Why is there a dot in your pattern?


You problem is most likely related to your pattern match.

We cannot help you analyse your pattern match, because we do not
have access to the string that is to be matched against.


> print scalar $1." Test \n";


There is no need to force a scalar to be a scalar, the concatenation
operator already forces its arguments to be scalars.


> open(MyFile,"test");


You should always, yes *always*, check the return value from open():

   open(MYFILE, 'test') or die "could not open 'test' $!";



Please see the Posting Guidelines for tips that will allow us
to answer your question on the first go-round, rather than
having several generations of followups asking for more information:

   http://mail.augustmail.com/~tadmc/clpmisc.shtml


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 22 May 2003 11:01:37 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Shutting Down Windoze
Message-Id: <3eccacf9.3614835859@news.cis.dfn.de>

On 21 May 2003 22:12:38 GMT, Abigail <abigail@abigail.nl>
wrote:

>Andrew Rich (andrew.rich@bigpond.com) wrote on MMMDL September MCMXCIII
>in <URL:news:pan.2003.05.21.15.17.19.898385@bigpond.com>:

>))  Does anyone know how to shutdown windoze ?

>With a Perl program? I've had success with:
>
>    perl -e "print qq !\t\t\b\b\b\b\b\b\b\b\b\b\b\b! while 1"

You have?  How on earth did you manage that?

On your advice I tried it and it completely failed to
shut down my Windows machine although of course 
I had to stop the program eventually.
-- 
Regards, Helgi Briem
helgi DOT briem AT decode DOT is


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

Date: 22 May 2003 11:23:39 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Shutting Down Windoze
Message-Id: <slrnbcpcpr.kuj.abigail@alexandra.abigail.nl>

Helgi Briem (helgi@decode.is) wrote on MMMDLI September MCMXCIII in
<URL:news:3eccacf9.3614835859@news.cis.dfn.de>:
;;  On 21 May 2003 22:12:38 GMT, Abigail <abigail@abigail.nl>
;;  wrote:
;;  
;; >Andrew Rich (andrew.rich@bigpond.com) wrote on MMMDL September MCMXCIII
;; >in <URL:news:pan.2003.05.21.15.17.19.898385@bigpond.com>:
;;  
;; >))  Does anyone know how to shutdown windoze ?
;;  
;; >With a Perl program? I've had success with:
;; >
;; >    perl -e "print qq !\t\t\b\b\b\b\b\b\b\b\b\b\b\b! while 1"
;;  
;;  You have?  How on earth did you manage that?
;;  
;;  On your advice I tried it and it completely failed to
;;  shut down my Windows machine although of course 
;;  I had to stop the program eventually.


http://homepages.tesco.net/~J.deBoynePollard/FGA/csrss-backspace-bug.html



Abigail
-- 
 :;$:=~s:
-:;another Perl Hacker
 :;chop
$:;$:=~y:;::d;print+Just.$:


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

Date: Thu, 22 May 2003 11:41:13 GMT
From: helgi@decode.is (Helgi Briem)
Subject: Re: Shutting Down Windoze
Message-Id: <3eccb72c.3617446913@news.cis.dfn.de>

On 22 May 2003 11:23:39 GMT, Abigail <abigail@abigail.nl>
wrote:

>Helgi Briem (helgi@decode.is) wrote on MMMDLI September MCMXCIII in
><URL:news:3eccacf9.3614835859@news.cis.dfn.de>:
>;;  On 21 May 2003 22:12:38 GMT, Abigail <abigail@abigail.nl>
>;;  wrote:
>;;  
>;; >Andrew Rich (andrew.rich@bigpond.com) wrote on MMMDL September MCMXCIII
>;; >in <URL:news:pan.2003.05.21.15.17.19.898385@bigpond.com>:
>;;  
>;; >))  Does anyone know how to shutdown windoze ?
>;;  
>;; >With a Perl program? I've had success with:
>;; >
>;; >    perl -e "print qq !\t\t\b\b\b\b\b\b\b\b\b\b\b\b! while 1"
>;;  
>;;  You have?  How on earth did you manage that?
>;;  
>;;  On your advice I tried it and it completely failed to
>;;  shut down my Windows machine although of course 
>;;  I had to stop the program eventually.
>
>
>http://homepages.tesco.net/~J.deBoynePollard/FGA/csrss-backspace-bug.html

Interesting.  That explains why it had no effect on my
machine.
-- 
Regards, Helgi Briem
helgi DOT briem AT decode DOT is


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

Date: Thu, 22 May 2003 11:56:51 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: Software Engineer - Verilog/Perl - EDA tool development - Cambridge,  UK - to =?ISO-8859-1?Q?c=A330?=,000
Message-Id: <3ECCBAEF.9050809@dev.null>



ECM Selection Ltd wrote:

> A great opportunity for a young Grad/PhD engineer to join a  near start-up
> company developing advanced EDA tools for low-power device design.
> 

A much better place to post these is http://jobs.perl.org/



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

Date: Thu, 22 May 2003 12:12:37 +0100
From: "ECM Selection Ltd" <topjob@ecmsel.co.uk>
Subject: Software Engineer - Verilog/Perl - EDA tool development - Cambridge, UK - to c£30,000
Message-Id: <Lg2za.7347$0a4.1416927@newsfep2-win.server.ntli.net>

A great opportunity for a young Grad/PhD engineer to join a  near start-up
company developing advanced EDA tools for low-power device design.

For further information visit:

www.High-Tech-Jobs.co.uk

Try the Brainbuster - You could win a prize worth £250!

or call/email 01638 742244 topjob@ecmsel.co.uk quoting ref: 12976

To apply for these appointments  you must have the right to live and work in
the EU.

ECM Selection Ltd - High-Tech Recruitment Specialists





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

Date: 22 May 2003 05:42:53 -0700
From: grehom@ntlworld.com (Graham Smith)
Subject: Win32::OLE
Message-Id: <98eb7f13.0305220442.13e9cbe2@posting.google.com>

I am trying to use OLE to automate plotting points in DesignCAD to
save laboriously typing in each coordinate and have got stuck
translating the following bit of Visual Basic

    DcPts.GetUserPoint X, Y, Z

I have tried the following:

    my $x = Variant(VT_R8, 0.0);
    my $y = Variant(VT_R8, 0.0);
    my $z = Variant(VT_R8, 0.0);

    $DcPts->GetUserPoint($x, $y, $z)
	or die( "Unable to get user point ", Win32::OLE->LastError() );
    print "x=$x, y=$y, z=$z\n";

The problem is when the code runs it returns the following error:

	C:\perlSrcs\DesignCad>perl -w draw_points_rel.pl u 5 r 5 d 5 l 5
	Win32::OLE(0.1603) error 0x80020005: "Type mismatch"
	    in METHOD/PROPERTYGET "GetUserPoint" argument 1 at
draw_points_rel.pl line 91

The OLE Browser documents the function as follows:

    Function GetUserPoint(dX As Double, dY As Double, dZ As Double) As
Boolean Member of DesignCAD.CmdPoints

The rest of the program is working fine and it plots points but I need
the above function as part of the code to tell it where I want the
first point to go.  I guess it's irrelevant what the program is for!


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

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.  

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


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