Re: How to build an executable on Windows

2005-10-18 Thread Octavian Rasnita
I have used ActiveState perlapp, and it works the best.
Indigo Star perl2exe works fine, but I found that it might give errors.
Maybe I was doing something wrong.
PAR is a free package that can create .exe files that can be downloaded from
CPAN. It works pretty well, but I found that it creates bigger files.

Teddy

- Original Message - 
From: "Timothy Johnson" <[EMAIL PROTECTED]>
To: "kathyjjja" <[EMAIL PROTECTED]>; 
Sent: Tuesday, October 18, 2005 10:55 PM
Subject: RE: How to build an executable on Windows



There are three products that I know of, but two of them cost money.

ActiveState has a great Perl Dev Kit that includes PerlApp, which will
package your perl script, modules, and interpreter into an executable.
It works very well.  You also get some other great utilities with it,
like PerlSvc, which allows you to create PerlApp-style executables that
run as services.

There is also a product called Perl2Exe by IndigoStar which I am told
works well, but I haven't used it.

Neither of these compile the Perl code, they both just package it in a
way that is redistributable, so the size of the executables can be
fairly large (500KB to 2MB), depending on which modules you use and
whether they include large DLLs).

There is also PAR on CPAN, but I haven't used that either:
http://search.cpan.org/~autrijus/PAR-0.85/lib/PAR/Tutorial.pod



-Original Message-
From: kathyjjja [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 18, 2005 12:49 PM
To: beginners@perl.org
Subject: How to build an executable on Windows

Hello everyone,

I am running Active State Perl on my PC and want to build a .exe. Does
anyone know the command for that?

Thanks,
Kathy


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: white space between roam and act

2005-10-18 Thread Thomas Bätzler
K.Moeng <[EMAIL PROTECTED]> asked:
> I have rephrased my question from yesterday,
> 
> I want to be able to ignore the white space in between ROAM 
> and ACT that is return the query as ROAM ACT without falling 
> to the else statement.
> 
> $msg = $ARGV[0];
> 
> $msg =~ s/\"/' /ig;

You do not have to escape the double quote here.

> $found = 0;
> 
> if ($msg =~ /roam act/i)

if ($msg =~ /roam\s*act/i){

matches roamact, roam act, roam  act, ...

HTH,
Thomas

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: white space between roam and act

2005-10-18 Thread Suvajit Sengupta

Hi,
To ignore the white space in between ROAM and ACT use /x modifier of 
Perl RE to extend your pattern's legibility by permitting  whitespace 
and comments. Hope that will serve your purpose.

Instead of

if ($msg =~ /roam act/i)

Use

if ($msg =~ /roam act/ix)

Regards,
Suvajit



K.Moeng wrote:


Hello again,

I have rephrased my question from yesterday,

I want to be able to ignore the white space in between ROAM and ACT
that is return the query as ROAM ACT without falling to the else statement.

$msg = $ARGV[0];

$msg =~ s/\"/' /ig;

$found = 0;

if ($msg =~ /roam act/i)
{
$name = 'ACTivated';
$found = 1;
}

elsif ($msg =~ /roam dact/i)

{
$name = 'DeACTivated';
$found = 1;
}

if ($found == 1)

print ".Thank you..\n";
}

else
{
print "Sorry. Your request has not been sent for Roaming.\n";
}


 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: white space between roam and act

2005-10-18 Thread Elie De Brauwer

Elie De Brauwer wrote:

K.Moeng wrote:


Hello again,

I have rephrased my question from yesterday,

I want to be able to ignore the white space in between ROAM and ACT
that is return the query as ROAM ACT without falling to the else 
statement.


$msg = $ARGV[0];

$msg =~ s/\"/' /ig;

$found = 0;

if ($msg =~ /roam act/i)
{
 $name = 'ACTivated';
 $found = 1;
}

elsif ($msg =~ /roam dact/i)

{
 $name = 'DeACTivated';
 $found = 1;
 }

 if ($found == 1)

print ".Thank you..\n";
}

else
{
 print "Sorry. Your request has not been sent for Roaming.\n";
}

I also assume you are aware that your "if ($found)" block is in the 
wrong place as it should be beneath the else (or another one should be 
added in the first if block.




-> Actually you have a missing { after your last if which my 'still too 
early in the morning mental perl interpreter' didn't see the first time.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: white space between roam and act

2005-10-18 Thread Beau E. Cox
Hi K.Moeng -
  
At 2005-10-18, 20:00:28 you wrote:
>Hello again,
>
>I have rephrased my question from yesterday,
>
>I want to be able to ignore the white space in between ROAM and ACT
>that is return the query as ROAM ACT without falling to the else statement.
>
>$msg = $ARGV[0];
>
>$msg =~ s/\"/' /ig;

the /i doesn't do anything here; " does not have to be escaped:
  $msg =~ s/"/'/g;

>
>$found = 0;
>
>if ($msg =~ /roam act/i)

Whitespace is \s  ( by default ( |\t|\n) ) 
Zero or more whitespaces is \s*
One or more whitespaces is \s+
so:

 if ($msg =~ /roam\s+act/i)

>{
> $name = 'ACTivated';
> $found = 1;
>}
>
>elsif ($msg =~ /roam dact/i)

and:

 elsif ($msg =~ /roam\s+dact/i)

>
>{
> $name = 'DeACTivated';
> $found = 1;
> }
>
> if ($found == 1)
>
>print ".Thank you..\n";
>}
>
>else
>{
> print "Sorry. Your request has not been sent for Roaming.\n";
>}
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.0.344 / Virus Database: 267.12.4/142 - Release Date: 10/18/2005



Aloha => Beau;
[EMAIL PROTECTED]
2005-10-18



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: white space between roam and act

2005-10-18 Thread Elie De Brauwer

K.Moeng wrote:

Hello again,

I have rephrased my question from yesterday,

I want to be able to ignore the white space in between ROAM and ACT
that is return the query as ROAM ACT without falling to the else statement.

$msg = $ARGV[0];

$msg =~ s/\"/' /ig;

$found = 0;

if ($msg =~ /roam act/i)
{
 $name = 'ACTivated';
 $found = 1;
}

elsif ($msg =~ /roam dact/i)

{
 $name = 'DeACTivated';
 $found = 1;
 }

 if ($found == 1)

print ".Thank you..\n";
}

else
{
 print "Sorry. Your request has not been sent for Roaming.\n";
}




Hello,

So you basicly mean to match  FOOroamactBAR ?

if( $msg =~ /roam +act/i) will match a number of spaces larger than or 
equal to 1: "roam act and roam  act but not roamact"
if( $msg =~ /roam *act/i) will match zero or more spaces:  "roam act and 
roam  act and roamact"

while the code you wrote
if( $msg =~ /roam act/i) will match exactly one space so only "roam act"

I also assume you are aware that your "if ($found)" block is in the 
wrong place as it should be beneath the else (or another one should be 
added in the first if block.


Or do you still mean something else ?

hth
E.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




white space between roam and act

2005-10-18 Thread K.Moeng
Hello again,

I have rephrased my question from yesterday,

I want to be able to ignore the white space in between ROAM and ACT
that is return the query as ROAM ACT without falling to the else statement.

$msg = $ARGV[0];

$msg =~ s/\"/' /ig;

$found = 0;

if ($msg =~ /roam act/i)
{
 $name = 'ACTivated';
 $found = 1;
}

elsif ($msg =~ /roam dact/i)

{
 $name = 'DeACTivated';
 $found = 1;
 }

 if ($found == 1)

print ".Thank you..\n";
}

else
{
 print "Sorry. Your request has not been sent for Roaming.\n";
}



Re: Matchin 2 strings

2005-10-18 Thread K.Moeng




> OK,
> 
> If i execute it this way, 
> C:\perl activate.pl 26771214478 ROAM ACT
> 
> activate.pl is the name of the file
> 26771214478 is the $source
> "Roam ACT" is the 2 query strings
> 
> hopes it makes sense
> 
> 
> 
> 
> - Original Message - 
> From: "Xavier Noria" <[EMAIL PROTECTED]>
> To: "beginners perl" 
> Sent: Tuesday, October 18, 2005 6:21 PM
> Subject: Re: Matchin 2 strings
> 
> 
> > On Oct 18, 2005, at 18:13, K.Moeng wrote:
> > 
> > > Here is my problem. i am unable to return the 2 strings as true. it  
> > > false back to the else statement.
> > 
> > Could you please reword the problem? Which strings? Where is the  
> > comparison? Back to where? How can you go back to an else?
> > 
> > -- fxn
> > 
> > 
> > -- 
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >  
> > 
> > 
> > 
> 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Destroying an object

2005-10-18 Thread Daniel Kasak

Jeff 'japhy' Pinyan wrote:


On Oct 18, Daniel Kasak said:

I've got an OO object that I want to destroy from inside the object 
itself.


sub destroy_self {
 my $self = shift;
 $self = undef;
}

But this doesn't work. What is the correct way of doing it?



That's because you're not getting rid of the CONTENTS of the object, 
you're merely undefining a variable that holds a reference to the 
contents.


Ordinarily, you can just wait for the object to go out of scope and it 
will be destroyed by Perl.  However, if you want to do it when you 
want to, here's a sneaky way:


  sub kill_object {
undef $_[0];
  }

Call it as

  $obj->kill_object;

and the object will be destroyed.


While I understand the logic behind this, it unfortunately doesn't work; 
the object persists! Time for some example code.

The code in my OO module ( forms::countries ) that should destroy itself:

---

sub destroy_self {
  undef $_[0];
}

---

The code in my app that should take advantage of the existance of the 
above object:


---

sub on_Countries_clicked {
  
   if ( $countries ) {

   $countries->{form}->get_widget("Countries")->present;
   } else {
   $countries = forms::countries->new( $form_options );
   }
  
}


---

I've stepped the code through a debugger, and the destroy_self() sub is 
being run at the right time ... but the object still persists, and when 
I click on a button and on_Countries_clicked is called, the 1st option:


$countries->{form}->get_widget("Countries")->present;

is executed instead of the 2nd:

$countries = forms::countries->new( $form_options );

I am working around this currently by simply destroying the {form} bit, eg:

---

sub destroy_self {
  my $self = shift;
  $self->{form} = undef;
}

---

and then testing for the existance of $countries->{form} instead of just 
$countries. But this isn't ideal.


What am I doing wrong?

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: How to build an executable on Windows

2005-10-18 Thread Timothy Johnson

There are three products that I know of, but two of them cost money.

ActiveState has a great Perl Dev Kit that includes PerlApp, which will
package your perl script, modules, and interpreter into an executable.
It works very well.  You also get some other great utilities with it,
like PerlSvc, which allows you to create PerlApp-style executables that
run as services.

There is also a product called Perl2Exe by IndigoStar which I am told
works well, but I haven't used it.

Neither of these compile the Perl code, they both just package it in a
way that is redistributable, so the size of the executables can be
fairly large (500KB to 2MB), depending on which modules you use and
whether they include large DLLs).

There is also PAR on CPAN, but I haven't used that either:
http://search.cpan.org/~autrijus/PAR-0.85/lib/PAR/Tutorial.pod



-Original Message-
From: kathyjjja [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 18, 2005 12:49 PM
To: beginners@perl.org
Subject: How to build an executable on Windows

Hello everyone,
 
I am running Active State Perl on my PC and want to build a .exe. Does
anyone know the command for that?
 
Thanks,
Kathy


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: How to build an executable on Windows

2005-10-18 Thread Steve Bertrand

> I am running Active State Perl on my PC and want to build a 
> .exe. Does anyone know the command for that?

Although I have only ever built one Perl app on Windows and develop
everything on Unix, I found the following to work tremendously well for
what you want to do:

http://www.indigostar.com/perl2exe.htm -- Perl2Exe

...it's only $49 US per workstation, so if you are going to be doing
many apps for Windows that you want the code sealed up, this will work.

BTW...this is not a plug or an ad. I just found it useful, and it was
the first listing in google when I searched at the time I needed it.

I'd like to hear input from others if any OSS apps out there will do
this same thing.

HTH...regards,

Steve

>  
> Thanks,
> Kathy
> 
>   
> -
>  Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




How to build an executable on Windows

2005-10-18 Thread kathyjjja
Hello everyone,
 
I am running Active State Perl on my PC and want to build a .exe. Does anyone 
know the command for that?
 
Thanks,
Kathy


-
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Re: Digest::MD5 hexdigest() and md5_hex() differ

2005-10-18 Thread Adriano Ferreira
On 10/18/05, Gert <[EMAIL PROTECTED]> wrote:
> in the example below I am using Digest::MD5 for computing the md5-checksum
> for a string. The first solution uses the function md5_hex, the second way
> uses the OO method hexdigest. The results are not equal. Shouldn't they be
> equal? I think they should?

If you run your script under -w or add "use warnings", you will see

  &Digest::MD5::md5_hex function probably called as class
method at try.pl line 8.

What means that what you really want is

  my $cs= Digest::MD5::md5_hex($text);

where -> between "Digest::MD5" and "md5_hex" gives place to "::". With
this simple change, the output turns to

172b442fcbe775a552d8afda30ac6821
172b442fcbe775a552d8afda30ac6821

Your original code were computing the MD5 digest of the bareword
"Digest::MD5" plus the text. It is all there in the synopsis of
Digest::MD5 docs.

Regards,
Adriano.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Matchin 2 strings

2005-10-18 Thread JupiterHost.Net



K.Moeng wrote:


hello.


Hello,

Here is my problem. i am unable to return the 2 strings as true. 


you're not returning anything anywhere...


it false back to the else statement.


have you tried printing $msg to see what it contains to manually verify 
it matches what you think it matches?


# always always always
use strict;
use warnings;


use lib '/usr/lib/perl5';


Why? POSIX should be in @INC already


use POSIX qw(strftime);


You never use this, why have it?


 GET ARGS ##
$source = $ARGV[0];
$msg = $ARGV[1];

$msg =~ s/\"/' /ig;#$msg =~ s/"/' /ig;  #$msg =~ s/\"/' /ig;

$found = 0;


print "DEBUG: \$msg = $msg\n";


if ($msg =~ /roam act/i)
{
 $name = 'ACTivated';
 $found = 1;
}

elsif ($msg =~ /roam dact/i)

{
 $name = 'DeACTivated';
 $found = 1;
 }

 if ($found == 1)

print "Your Prepaid Roaming service will be $name within the next 2 hours.Thank you. 
\n";
}

else
{
 print "Sorry. Your request has not been sent for Roaming. Please send 'ROAM ACT' TO 
ACTIVATE or 'ROAM DACT' TO DEACTIVATE.\n";
}

exit;


You don't need exit()...

Try this:

#!/usr/bin/perl

use strict;
use warnings;

if($ARGV[0] =~ /roam act/i) {
print two_hour_notice('ACTivated');
}
elsif($ARGV[0] =~ /roam dact/i) {
print two_hour_notice('DeACTivated');
}
else {
print "Unknown input: $ARGV[0]\n";
}

sub two_hour_notice {
my $service_type = shift;
return "Your Prepaid Roaming service will be $service_type within 
the next 2 hours.Thank you.\n";

}

./test.pl "iroam activ"
./test.pl "iroam dacti"
./test.pl "foo bar baz"

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




perten matching

2005-10-18 Thread K.Moeng

hello.

Here is my problem. i am unable to return the 2 strings as true. it false back 
to the else statement.

use lib '/usr/lib/perl5';
use POSIX qw(strftime);

 GET ARGS ##
$source = $ARGV[0];
$msg = $ARGV[1];

$msg =~ s/\"/' /ig;#$msg =~ s/"/' /ig;  #$msg =~ s/\"/' /ig;

$found = 0;

if ($msg =~ /roam act/i)
{
 $name = 'ACTivated';
 $found = 1;
}

elsif ($msg =~ /roam dact/i)

{
 $name = 'DeACTivated';
 $found = 1;
 }

 if ($found == 1)

print "Your Prepaid Roaming service will be $name within the next 2 hours.Thank 
you. \n";
}

else
{
 print "Sorry. Your request has not been sent for Roaming. Please send 'ROAM 
ACT' TO ACTIVATE or 'ROAM DACT' TO DEACTIVATE.\n";
}

exit;



Digest::MD5 hexdigest() and md5_hex() differ

2005-10-18 Thread Gert
Hello,

in the example below I am using Digest::MD5 for computing the md5-checksum
for a string. The first solution uses the function md5_hex, the second way
uses the OO method hexdigest. The results are not equal. Shouldn't they be
equal? I think they should?


#!perl

use strict;
use Digest::MD5;

my $text = "bla foo \n a new line...\n";

my $cs= Digest::MD5->md5_hex($text);
print "$cs\n";

my $md5 = Digest::MD5->new;
$md5->add($text);
$cs = $md5->hexdigest;
print "$cs\n";


Output:

297b58824c81ad1869c45c1cc33a378b
172b442fcbe775a552d8afda30ac6821


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Matchin 2 strings

2005-10-18 Thread Xavier Noria

On Oct 18, 2005, at 18:13, K.Moeng wrote:

Here is my problem. i am unable to return the 2 strings as true. it  
false back to the else statement.


Could you please reword the problem? Which strings? Where is the  
comparison? Back to where? How can you go back to an else?


-- fxn


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Matchin 2 strings

2005-10-18 Thread K.Moeng


hello.

Here is my problem. i am unable to return the 2 strings as true. it false back 
to the else statement.

use lib '/usr/lib/perl5';
use POSIX qw(strftime);

 GET ARGS ##
$source = $ARGV[0];
$msg = $ARGV[1];

$msg =~ s/\"/' /ig;#$msg =~ s/"/' /ig;  #$msg =~ s/\"/' /ig;

$found = 0;

if ($msg =~ /roam act/i)
{
 $name = 'ACTivated';
 $found = 1;
}

elsif ($msg =~ /roam dact/i)

{
 $name = 'DeACTivated';
 $found = 1;
 }

 if ($found == 1)

print "Your Prepaid Roaming service will be $name within the next 2 hours.Thank 
you. \n";
}

else
{
 print "Sorry. Your request has not been sent for Roaming. Please send 'ROAM 
ACT' TO ACTIVATE or 'ROAM DACT' TO DEACTIVATE.\n";
}

exit;



Re: ssh and sudo not working together....

2005-10-18 Thread Chris Devers
On Mon, 17 Oct 2005, O'Brien, Bill wrote:

> I have this so far but it is not allowing sudo, just wondering if it 
> is NET::SSH or that RSA type of SSH we are running?  I have tried to 
> pass numerous commands but that doesn't seem to work, how can I run 
> numerous commands via the single SSH connection?

Stepping away from Perl for a moment, if you're trying to have ssh run 
an interactive command, such as sudo, then you have to allocate a tty 
for that command to interact within. With the ssh command, you have:

  $ man ssh | grep -i '\-[a-z] .*alloc'
-T   Disable pseudo-tty allocation.
-t   Force pseudo-tty allocation. This can be used to execute arbi-
  $

Therefore, you can do things like:

  $ ssh -t [EMAIL PROTECTED] "sudo ls -al"

This will connect to $host and issue the command; sudo will then come 
back over the ssh connection and ask you to authenticate; once that is 
done, sudo will then proceed as normal. 

So, to get back to your question, I think what you need to do is figure 
out a way to pass the -t argument to ssh via Net::SSH. Skimming over the 
perldoc at , it looks like 
you might be able to use the ssh_cmd() method to set this up. Look up 
the section that mentions OPTIONS_HASHREF for hints, and good luck!



-- 
Chris Devers

÷0~‹œg±êˆ
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


Re: Destroying an object

2005-10-18 Thread Jeff 'japhy' Pinyan

On Oct 18, Daniel Kasak said:


I've got an OO object that I want to destroy from inside the object itself.

sub destroy_self {
 my $self = shift;
 $self = undef;
}

But this doesn't work. What is the correct way of doing it?


That's because you're not getting rid of the CONTENTS of the object, 
you're merely undefining a variable that holds a reference to the 
contents.


Ordinarily, you can just wait for the object to go out of scope and it 
will be destroyed by Perl.  However, if you want to do it when you want 
to, here's a sneaky way:


  sub kill_object {
undef $_[0];
  }

Call it as

  $obj->kill_object;

and the object will be destroyed.  The reason this works and '$self = 
undef' doesn't is because the elements of @_ act as aliases; if you 
operate on elements of @_ DIRECTLY, you can affect changes in the things 
passed to the function.  Here's a more general example:


  sub trim {
for (@_) { s/^\s+//, s/\s+$// }
  }

This trim() function doesn't *return* trimmed string, it trims the strings 
you sent it:


  @words = ("  this", "  and  ", " that   ");
  trim(@words);
  print "[EMAIL PROTECTED]";  # [this and that]

Of course, you can't send an ACTUAL string to trim(), because you can't 
modify a constant string:


  trim("  hello  ");  # run-time fatal error

--
Jeff "japhy" Pinyan%  How can we ever be the sold short or
RPI Acacia Brother #734%  the cheated, we who for every service
http://www.perlmonks.org/  %  have long ago been overpaid?
http://princeton.pm.org/   %-- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Which is better?

2005-10-18 Thread Marcello

M. Lewis ha scritto:

Thanks Thomas. Appreciated.

Thomas Bätzler wrote:


Hi,
M. Lewis <[EMAIL PROTECTED]> asked:

Charles K. Clarkson recently replied to Sreedhar Reddy in which one 
of the corrections he made was:


open my $fh, '<', $input_file or die qq(Cannot open "$input_file": $!);



[...]


When I have opened a file, I have always done:

open (FILE, $file) || die "Cannot open $file :$!";

A couple of things different.
- I use a FILEHANDLE, where Charles used a variable.




Passing a filehandle to a subroutine is possible, but if
you use IO::Handle objects like Charles, it's much easier.


- Charles explicitly said the file was being opened for reading. My 
understanding is that is the default. I assume that Charles did this 
for clarity.




Security, too. In Charles' case, all the open ever does is
try to open a file. In your case, it could be used to do
almost anything. That's fine as long as your code runs on
your box only, probably with a fixed "my $file = ..."
right above it - but just imagine your code if part of a
CGI program and $file is a CGI parameter, and somebody
set it to '/bin/rm -rf /|'.



I rarely do CGI stuff so this really isn't really in my realm, although 
I can see how via your example, it would be a good idea to make that a 
habit.




- Charles opted to use qq() which cause him to have to enclose the 
$input_file in "".




Dead wrong. He used qq() so that he did not have to quote
the "" inside a string which he wanted to be interpolated.

Delimiting arguments in an error message by quotes is a very good idea 
because it lets you see leading or trailing

whitespace which you'd otherwise miss.




You've lost me here Thomas. Again, his code was:

open my $fh, '<', $input_file or die qq(Cannot open "$input_file": $!);

What am I missing here?


I hope this 3-lines script will clarify the issue:

my $var = "world";
print qq(Hallo "$var"\n);
print qq(Hallo $var \n);

HTH

[snip]

--
Marcello Romani
Developer
Spin s.r.l.
Reggio Emilia
http://www.spinsoft.it


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Destroying an object

2005-10-18 Thread Mulander
--cut--
> sub destroy_self {
>
>my $self = shift;
>$self = undef;
>
> }
--cut--

The destroy method must be named DESTROY ( case-sensitive )
So you would have to do:
sub DESTROY {
my $self = shift;
undef $self;
}

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: Alcatel CORBA 5620 OSS

2005-10-18 Thread Tielman Koekemoer \(TNE\)

> > We have an Alcatel CORBA 5620 gateway from which we have extract
> > information. Does anyone know of a module that would enable Perl
to
> > access this service?
> >
> > I searched the CPAN's archive but could not find anything.
> Apologies
> > if this is the wrong list to ask - which would be the best list?
>
> I don't know what an "Alcatel CORBA 5620 gateway" is, and
> alcatel.com doesn't help much either:
>

>
> Do you know what it is? Could you explain to us what it is,
> what it does, and how it's accessible? I'm going to assume
> that "from which we have extract information" means that you
> need to get some information off of the gateway thingy. Is
> that correct? More info is always good.

The above CORBA 5620 OSS module is part of Alcatel's Network Manager
(manages network faults and has a dynamic topology view of a managed
network). The module makes network topology information available
through a network CORBA interface using IOR files and the like. We
need this topology information to do fault event correlation i.e. link
A-B is down due to power failure so all faults received by Netcool
Omnibus is a symptom of a power problem.

The CORBA interface can be written in Perl using the COPE module but I
was hoping to hear from someone that already had an interface (module)
written for this.

TIA!


~~
This e-mail and its contents are subject to the Telkom SA Limited
e-mail legal notice available at
http://www.telkom.co.za/TelkomEMailLegalNotice.PDF
~~

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]