Mr. Shawn H. Corey wrote:
On Sat, 2008-09-20 at 03:53 -0700, John W. Krahn wrote:
itshardtogetone wrote:
Hi,
Hello,
How do I randomly produce a date between 1st Jan 1960 to 31th December
1985. It must be able to show the day month year.
I only know how to produce a random number between 1960
itshardtogetone wrote:
- Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]>
use Time::Local;
my $start = timegm 0,0,0,1,0,60;
my $end = timegm 0,0,0,1,0,86;
print scalar gmtime $start + rand $end - $start;
Hi,
Thanks.
(1) But the above from time to time produce the fol
On Sep 18, 11:49 am, [EMAIL PROTECTED] (Back9) wrote:
> Hello,
>
> Is there a way to append a text file to an existing text file.
> For example,
> File A:
> Jan Feb Mar April ...
>
> File B:
> 10 30 40 20 ...
>
> After appending job, the File A would be like below.
> Jan Feb Mar April ...
> 10 30 4
On Sep 19, 11:31 am, [EMAIL PROTECTED] (John W. Krahn) wrote:
> Back9 wrote:
> > Hello,
>
> Hello,
>
> > Is there a way to append a text file to an existing text file.
> > For example,
> > File A:
> > Jan Feb Mar April ...
>
> > File B:
> > 10 30 40 20 ...
>
> > After appending job, the File A woul
Here's a string in my file,
#define MY2D_STRING"4.0.1.999.9"
of which I'm trying to increment the last digit; let's say with 1,
such that the output is 4.0.1.999.10
I've tried _various_ combinations, here's just one of them.
(This works partially, but not always).
perl -i -pe 'if (
On Fri, 2008-09-19 at 20:53 -0700, [EMAIL PROTECTED] wrote:
> Here's a string in my file,
>
> #define MY2D_STRING"4.0.1.999.9"
>
> of which I'm trying to increment the last digit; let's say with 1,
>
> such that the output is 4.0.1.999.10
>
> I've tried _various_ combinations, here'
NewbeeUnix wrote:
On Sep 18, 11:49 am, [EMAIL PROTECTED] (Back9) wrote:
Is there a way to append a text file to an existing text file.
For example,
File A:
Jan Feb Mar April ...
File B:
10 30 40 20 ...
After appending job, the File A would be like below.
Jan Feb Mar April ...
10 30 40 20 ...
[EMAIL PROTECTED] wrote:
Here's a string in my file,
#define MY2D_STRING"4.0.1.999.9"
of which I'm trying to increment the last digit; let's say with 1,
such that the output is 4.0.1.999.10
I've tried _various_ combinations, here's just one of them.
(This works partially, but not
Hello,
I am calling system() to run a devenv.exe to build vs 2005 solution
file.
My problem is I want to capture the output while building the solution
to a file and show the output to monitor at once.
Is there a way or a module to achieve that goal?
TIA
--
To unsubscribe, e-mail: [EMAIL PROT
On Fri, 2008-09-19 at 13:14 -0700, Back9 wrote:
> Hello,
>
> I am calling system() to run a devenv.exe to build vs 2005 solution
> file.
> My problem is I want to capture the output while building the solution
> to a file and show the output to monitor at once.
>
> Is there a way or a module to a
I am working on modifying a script that previously parsed Cisco ACL's
and changing it to parse IPS information.
Here is an example of the two log formats.
Sep 19 15:44:29 172.16.2.1 59800: 3725router: Sep 19 19:44:39: %SEC-6-
IPACCESSLOGP: list 104 denied udp 93.144.187.255(13157) ->
68.156.63.11
"John W. Krahn" schreef:
> Stephen Reese:
>> chomp ($acl=$ARGV[0]);
>> if ($acl eq "") { $acl=".*"};
>
> my $acl = $ARGV[ 0 ] || '.*';
The chomp() can make a difference:
$ perl -wle 'my $x = $ARGV[0] || q{.*}; print qq{<$x>}' ''
<.*>
$ perl -wle 'my $x = $ARGV[0] || q{.*}; print qq{<$x>}' '
'
On Sep 19, 10:07 pm, [EMAIL PROTECTED] (Stephen Reese) wrote:
> I am working on modifying a script that previously parsed Cisco ACL's
> and changing it to parse IPS information.
>
> Here is an example of the two log formats.
>
> Sep 19 15:44:29 172.16.2.1 59800: 3725router: Sep 19 19:44:39: %SEC-6-
On Sun, 2008-09-21 at 09:59 -0700, Ron Bergin wrote:
>
> > #!/usr/bin/perl
> > #
> You're missing 2 very important pragmas that should be in every script
> you write.
>
> use warnings; #
> use strict; # forces you to declare your vars prior to their use.
>
> > #
> > # Set behaviour
> > $log="/
Mr. Shawn H. Corey wrote:
On Sun, 2008-09-21 at 09:59 -0700, Ron Bergin wrote:
#!/usr/bin/perl
#
You're missing 2 very important pragmas that should be in every script
you write.
use warnings; #
use strict; # forces you to declare your vars prior to their use.
#
# Set behaviour
$log="/var/
John,
Thank you and everyone else for the insight to better Perl coding
practices in the original script. I have attempted to make the changes
that you recommended with negative results. I had a tough time trying
to determine what to leave in so before I move on to the new script I
would like to f
2008/9/22 Stephen Reese <[EMAIL PROTECTED]>:
>
> $ ./acl-parse.pl
> Global symbol "$x" requires explicit package name at ./acl-parse.pl
> line 22.
> Global symbol "$foo" requires explicit package name at ./acl-parse.pl
> line 23.
John is right.
You should always 'use strict' at the begin of the
> John is right.
> You should always 'use strict' at the begin of the scripts.
> Here you didn't declare the variables, so you got the errors.
> You could declare them with:
> my $x = ...;
> my $foo = ...;
>
> For Perl's variable scope, see this:
> http://perl.plover.com/FAQs/Namespaces.html
>
Jef
2008/9/22 Stephen Reese <[EMAIL PROTECTED]>:
>> John is right.
>> You should always 'use strict' at the begin of the scripts.
>> Here you didn't declare the variables, so you got the errors.
>> You could declare them with:
>> my $x = ...;
>> my $foo = ...;
>>
>> For Perl's variable scope, see this:
Hi Stephen,
John is saying that you need to declare them, not initializing them.
Declaring them means that you're saying that variable will be used;
initializing them means giving them a value. With "use strict", you
need to define them before you give them a value...which is a good
sanity
20 matches
Mail list logo