Jerry Preston wrote:
Hi!
This one is new to me and I need to be able to read $name and $age from the
following:
@history = (
{
program => 'new',
version => '0.42',
},
input => {
'/data' => 0.14,
'/home' => undef,
},
input_contents => '
$name = \'Jerry\
Vema Venkata wrote:
Hi Floks
when i am trying to run the following script
it is getting executed but when iam tryint to execute thru corntab it is not?can any one suggest
the script name is xapipgm.pl
***
#!/bin/sh
#
Ramprasad,
I have no choice in the data format!
Thanks,
Jerry
-Original Message-
From: Ramprasad [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 2:24 AM
To: [EMAIL PROTECTED]; Jerry Preston
Cc: [EMAIL PROTECTED]
Subject: Re: how to read?
Jerry Preston wrote:
> Hi!
>
> This
like the following
can you check and correct me if iam wrong
***
. /home/paradigm/.profile
#!/bin/sh
#myrun.shell
xapipgm=srvtst26.pl
pgrep -f $xapipgm > /dev/null
# runrc=$?
# echo "Return Code is: $?"
if [ $? -eq 0 ]
the
hi ,
I have a file cointaing 1024 hex numbers .
I want to convert them to Bin.
Please help
Vema --
...and then Vema Venkata said...
%
% have u got the soultion for this?
We don't know; she hasn't reported back after my suggestion.
% because iam following the same problem
Did you try my suggestion? Can you describe your problem in more detail?
Don't rely on someone else to tell us
open my $fh, "<", "items/list.db";
print while (<$fh>);
close $fh;
This is suppose to printout the content in items/list.db ,
but why I get somthing like "GLOB(0x162aca7)" ??
Thanks in advise.
On Sat, 16 Aug 2003 17:25:15 -0700 (PDT), [EMAIL PROTECTED] (Titu Kim)
wrote:
>Hi,
> Thanks for your reply. My purpose is not only to
>run uptime. I need to write a script to log into other
>machines to grep the log file contents. Now, I log in
>one by one and grep the log. I want to use the scr
Hi david
when i am trying to run the following script
it is getting executed but when iam tryint to execute thru corntab it
is not?can any one suggest
the script name is xapipgm.pl
***
#!/bin/sh
#myrun.shel
> hi ,
> I have a file cointaing 1024 hex numbers .
> I want to convert them to Bin.
> Please help
try something like this:
$hex = 0xff;
$bin = unpack("B32", pack("N", hex $hex));
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
From: Saadat Saeed <[EMAIL PROTECTED]>
> I am new to scripting (in general) and am an
> administrator of win32 based systems. I am deciding
> between Perl & a number of other scripting
> technologies to standardise upon.
>
> The only thing that'll convince me for now is the
> abiltity to read and
- Original Message -
From: "Li Ngok Lam" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 18, 2003 1:10 AM
Subject: I don't understand why this happen
open my $fh, "<", "items/list.db";
print while (<$fh>);
close $fh;
This is suppose to printout the content in items/li
The group helped me to get this small snippet working ..
and it works good for when I need to telnet to multiple and/or all servers.
#! /opt/perl5/bin/perl
# example using Telnet.pm to servers
require 'Telnet.pm';
# script server ip username password
$t = new Net::Telnet Timeout => 5,
On Mon, Aug 18, 2003 at 07:34:41AM -0400 Kipp, James wrote:
> > I have a file cointaing 1024 hex numbers .
> > I want to convert them to Bin.
> > Please help
>
> try something like this:
>
> $hex = 0xff;
> $bin = unpack("B32", pack("N", hex $hex));
The above assumes big-endian byteorder. For
Hi,
I tried to write a script to extrat data from the given DATA but I can find
the right regular expression to do that.
RULE: I need to catch everything between quotes (single or double) and if
inside exists a repeated quote (single or double) it is not seen as end of
the match.
#!/usr/bin/perl
On Monday, August 18, 2003, at 06:10 AM, Li Ngok Lam wrote:
open my $fh, "<", "items/list.db";
I can't test it right this second, but I'm guessing it's the my() call
inside of the open. Try this:
my $fh;
open $fh, '<', 'items/list.db' or die "File error: $!";
print while $fh;
close $fh;
Hope
> >
> > $hex = 0xff;
> > $bin = unpack("B32", pack("N", hex $hex));
>
> The above assumes big-endian byteorder. For little-endian use
> "V" instead
> of "N". Or just use "L" when the file has the same byteorder as the
> machine you are running this script on.
>
> Btw, the hex() above is probabl
>
> my $fh;
> open $fh, '<', 'items/list.db' or die "File error: $!";
It just the same as open my $fh =)
> print while $fh;
Hmm. I guess this is not a 'read' argument
Thanks in advise anyway =)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Thank you very much Beau. However, my question is not how to solve,
there are many ways in deed, but why this happen and what's that actually?
=)
The only problem I can bet here is because I use the Switch.pm in my script.
TIA, again
- Original Message -
From: "Beau E. Cox" <[EMAIL PRO
> Hi david
>
> when i am trying to run the following script
> it is getting executed but when iam tryint to execute thru
> corntab it is not?can any one suggest
>
> the script name is xapipgm.pl
Actually in your example below it is srvtst26.pl
Try using absolute paths. Sometimes cron w
Greetings,
I am attempting to make a hash of hashes or something equivalent but can't
seem to get it working properly. Here is what I have so far:
@name = ("one", "two", "three");
Foreach my $layer (@name) {
$thief_opt = {
$layer = {
type
Dude
iam using srvtst26.pl yes..
and the script is situtated in the following path i.e
"/proj/ahd02/CAisd/site/mods/scripts"
can u suggest me where i should use ...
-Original Message-
From: Dan Muey [mailto:[EMAIL PROTECTED]
Sent: Monday, 18 August 2003 6:55 PM
To: Vema Venkata; David
> Greetings,
>
> I am attempting to make a hash of hashes or something
> equivalent but can't seem to get it working properly. Here
> is what I have so far:
>
> @name = ("one", "two", "three");
>
> Foreach my $layer (@name) {
> $thief_opt = {
> $layer = {
>
> Dude
> iam using srvtst26.pl yes..
> and the script is situtated in the following path i.e
> "/proj/ahd02/CAisd/site/mods/scripts"
>
> can u suggest me where i should use ...
>
Sure :
xapipgm=/proj/ahd02/CAisd/site/mods/scripts/srvtst26.pl
Also permissions permissions permissions :)
HTH
D
I think you mean this...
use strict;
my %thief_opt;
my @name = ("one", "two", "three");
foreach my $layer (@name) {
$thief_opt{$layer} = {
type => "solid",
origin => "datum",
use_arcs => "yes",
};
}
# test with this. prints out structure to console.
use Data::Dumper;
pri
Can someone please point me to the right module for getting the name of a specified
day.
e.g.
I say 'year:2003 month:5 day:23'
I get 'Friday'
Thanks
Nigel
MIS Web Design
http://www.miswebdesign.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECT
This is exactly what I was after. Not being a "real" programmer I was
tripping on syntax as usual. Thanks for the help
Rz
.-. --..
-Original Message-
From: Hanson, Rob [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 9:50 AM
To: Zielfelder, Robert; Perl Beginners List
Time::Local, and the internal localtime().
use Time::Local;
my @days = qw(Sun Mon Tue Wed Thu Fri Sat);
my $time = timelocal(0,0,0,23,4,103);
my @parts = localtime($time);
print "$days[$parts[6]]\n";
Rob
-Original Message-
From: Nigel Peck - MIS Web Design [mailto:[EMAIL PROTECTED]
Se
On Monday, August 18, 2003, at 08:10 AM, Li Ngok Lam wrote:
my $fh;
open $fh, '<', 'items/list.db' or die "File error: $!";
It just the same as open my $fh =)
Save that it reads a little better, I think, and checks errors.
print while $fh;
Hmm. I guess this is not a 'read' argument
> From: "Dan Muey" <[EMAIL PROTECTED]>
> > All I hear are crickets on the list anybody there today?
>
> Hey I aint no cricket ;-)
I wasn't getting any messages from the list. I think it had to do with the black out.
Thanks for the input!
>
> > I'd like to have a simple spider that will look a
> Hi Dan,
>
> I don't think that is actually what he is asking for.Unless I
> misunderstand, he is referring to a pass-through program. Of
That's why I asked what he meant. The absolut simpleest would be:
#!/usr/bin/perl -w
use strict;
use CGI qw(header);
use File::Slurp;
pritn header();
p
Sorry for being so unresponsive Vema! I was away from my desk when you had
your problems. Unfortunately, I am
still trying to get my cron job working. My job seems to pick up fine, but
then it drops the path half way through because it
doesn't understand the path.The path is an absolute path which
no not yet i havent got any solution of it
-Original Message-
From: Trina Espinoza [mailto:[EMAIL PROTECTED]
Sent: Monday, 18 August 2003 7:56 PM
To: Vema Venkata; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: Cron jobs and perl
Sorry for being so unresponsive Vema! I was away from m
> Dan Muey wrote:
> > All I hear are crickets on the list anybody there today?
>
> Maybe its because the northeastern quarter of the US was
> blacked out all
> day... muuuhhh we have power!
Yup seems to be the blackout.
>
> >
> > Here's a quick thing I was wondering since I'm no http exp
Please post back to the list and not just me only.
> dude
> this is the error iam getting again
> **
>
> /proj/ahd02/CAisd/site/mods/scripts/xapipgm.pl:
> log/init/ahdxapi.init..log.: cannot create
>
"Eurospace Szarindar" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]
> Hi,
>
> I tried to write a script to extrat data from the given DATA but I can
find
> the right regular expression to do that.
Hi Szarindar,
Firstly why are you using this format and trying to parse it yourself?
On Sun, 17 Aug 2003 19:26:53 +0200, Björn_Brombach <[EMAIL PROTECTED]> wrote:
> I wanted to add some more details:
> When i use this skript:
>
> my $supported = Net::SSH::Perl::Cipher::supported();
> for my $cipher (sort @$supported) {
> print
> > "Scott" == Scott Taylor <[EMAIL PROTECTED]> writes:
>
> Scott> Any one have or know of a function to convert ugly
> "NAME, USER"
> Scott> to "User Name"?
>
I'd do soemthign like this:
my($name, $user) = split(/,/, $line);
$name =~ s/^\s+//;
$name = ucfirst(lc($n
Thanks you, it works fine. Could you explain me why have you added the \1 ?
I will have a look at Text::CSV
Michel
-Message d'origine-
De: Rob Anderson [mailto:[EMAIL PROTECTED]
Date: lundi 18 août 2003 16:39
À: [EMAIL PROTECTED]
Objet: Re: Regular expression help
"Eurospace Szarindar
Hi,
I have no idea how to do this.
I have a name
Anthony Bob
I want to put each letter in an array (no space)
for(0..$numbersofletters){
@letters[c]= A LETTER
}
so when i do print @letters i get
A
N
T
H
O
N
Y
B
O
B
something like that, any help is appreciated.
Anthony
--
To unsubscribe, e-mail
>
>"Eurospace Szarindar" <[EMAIL PROTECTED]> wrote in
message >news:[EMAIL PROTECTED]
>
>Thanks you, it works fine. Could you explain me why have you added the \1 ?
Hi,
A quick breakdown...
/(['"])(((''|"")|[^'"])*?)\1(\s|$)/g
^^
1
2
> Hi,
Howdy,
>
> I have no idea how to do this.
> I have a name
> Anthony Bob
> I want to put each letter in an array (no space)
> for(0..$numbersofletters){ @letters[c]= A LETTER } so when i
> do print @letters i get A N T H O N Y B O B something like
> that, any help is appreciated. Anthony
On Monday, August 18, 2003, at 10:29 AM, awards wrote:
Hi,
I have no idea how to do this.
I have a name
Anthony Bob
I want to put each letter in an array (no space)
my $name = 'Anthony Bob';
$name =~ tr/ //d; # remove the space
my @letters = split //, $name;
for(0..$numbersofletter
Hi,
That is quite simple. I tought it would be more difficult than that :-)
Thank you both of you
Anthony
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> Hi,
Howdy
>
> That is quite simple. I tought it would be more difficult
> than that :-)
>
It's cuz Perl rocks!!
> Thank you both of you
> Anthony
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
To unsubscribe, e-mail
Just to throw out another idea, you can also do this...
my $name = "Anthony Bob";
my @letters = grep {!/\s/} split('', $name);
# to test
print "@letters";
It also looks like you wanted upper case. You can do that with this...
my $name = "Anthony Bob";
my @letters = grep {!/\s/} split('', uc($n
Hi!
I have in $string something like:
$string="1
blabla";
When Im printing $string I get a new line between 1 and blabla, now I needt o
split that.. in
my($number, $real_string) = split...
How can I split it?
Thanks!
Pd. Its a scalar variable
Pablo
--
Pablo Fischer Sandoval ([EMAIL PROTECT
Like this...
$string="1
blabla";
my @lines = split("\n", $string);
# testing...
print "1: $lines[0]\n";
print "2: $lines[1]\n";
See perldoc -f split if you want more info on the command.
Rob
-Original Message-
From: Pablo Fischer [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003
>
> $string="1
> blabla";
>
> When Im printing $string I get a new line between 1 and blabla, now I
needt o
> split that.. in
>
> my($number, $real_string) = split...
my($number, $real_string) = split /\n/, $string;
HTH
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-m
HI,
What would be the best way to check for data integrity of an input?
Chomp (my $ans=);
#first make sure data is 6 digits
make sure length is 6
Thankx
Ned Cunningham
POS Systems Development
Monro Muffler Brake
200 Holleder Parkway
Rochester, NY 14615
(585) 647-6400 ext. 310
[EMAIL PROTECT
awards wrote:
> Hi,
>
> I have no idea how to do this.
> I have a name
> Anthony Bob
> I want to put each letter in an array (no space)
> for(0..$numbersofletters){
> @letters[c]= A LETTER
> }
> so when i do print @letters i get
> A
> N
> T
> H
> O
> N
> Y
> B
> O
> B
> something like that, any he
chomp (my $ans=);
$ans =~ /^\d{6}$/ or die "Bad input!";
# ...or...
unless ($ans =~ /^\d{6}$/) {
# blah, blah, blah
}
# Or loop until correct input received...
my $ans = undef;
do {
print "Invalid response\n" if defined $ans;
print "Enter your answer: ";
chomp($ans = );
} while $
Howdy all!
If you have a function that is expecting a FILEHANDLE as it's
argument how could you supply it a variable instead?
For instance:
my $mio = Mail::Internet(\*STDIN);
...
Which is peachy.
What I'd like to be able to do is use the data in
the vari
> Howdy all!
>
> If you have a function that is expecting a FILEHANDLE as it's
Sorry FILHANDLE Refence actually.
> argument how could you supply it a variable instead?
>
> For instance:
>
> my $mio = Mail::Internet(\*STDIN);
> ...
> Which is peachy.
> What I'd like to
There are ways to fake a filehandle by tieing it to a module, but that is a
bit cumbersome. Looking at the Mail::Internet docs it seems that you can
pass it an array reference instead of a filehandle ref.
Try this, I think it will work...
my $mio = Mail::Internet([$data]);
Rob
-Original M
> There are ways to fake a filehandle by tieing it to a module,
> but that is a bit cumbersome. Looking at the Mail::Internet
> docs it seems that you can pass it an array reference instead
> of a filehandle ref.
>
Oh yeah I see that now, that may be just the ticket.
I'll try it out and let
Thanks for everybody that has given there input. I have changed a few things up and
all is good.
Thanks,
Keith
On Fri, 15 Aug 2003, Keith Olmstead wrote:
Date: Fri, 15 Aug 2003 16:16:44 -0500 (CDT)
From: Keith Olmstead <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Check my script
Hello,
> > There are ways to fake a filehandle by tieing it to a module,
> > but that is a bit cumbersome. Looking at the Mail::Internet
> > docs it seems that you can pass it an array reference instead
> > of a filehandle ref.
> >
>
>
> Oh yeah I see that now, that may be just the ticket.
> I'll tr
Hi,
I've been involved with Perl for many years (too many to count right
now). One question has been bugging me lately, and maybe it's because I
don't know enough about it, or maybe it's because I've been "Not the
biggest fan" of Mr. Bill and his org... Either way, I'm attempting to
learn about
On Mon, 18 Aug 2003 12:40:02 -0700, Rich Parker <[EMAIL PROTECTED]> wrote:
> Hi,
> I've been involved with Perl for many years (too many to count right
> now). One question has been bugging me lately, and maybe it's because I
> don't know enough
Jerry Preston <[EMAIL PROTECTED]> wrote:
:
: This one is new to me and I need to be able to
: read $name and $age from the following:
:
: @history = (
: {
: program => 'new',
: version => '0.42',
: },
: input => {
: '/data' => 0.14,
: '/home' => undef,
: },
:
T.S.Ravi Shankar wrote:
> Hi all :
>
> I have few arrays with names starting with "xyz_". After the initial
> definitions I want to change values of a particular index of all arrays
> whose names start with "xyz_". It would be cumbersome for me to do
> something like :
>
> $xyz_blahblah[$index
Hi All,
I want to read contents of a dir, filtered, into a hash. I have this:
#/usr/local/bin -w
use strict;
my (@ARRAY, %TEST, $FILTER) = "";
print "Enter filter:";
$FILTER = ;
chomp $FILTER;
@ARRAY = ` ls -l /foo/bar | grep "$FILTER" `;
for (@ARRAY) {
chomp;
}
This gets just the info I want,
[EMAIL PROTECTED] wrote:
> Hi All,
>
> I want to read contents of a dir, filtered, into a hash. I have this:
>
> #/usr/local/bin -w
> use strict;
> my (@ARRAY, %TEST, $FILTER) = "";
>
> print "Enter filter:";
> $FILTER = ;
> chomp $FILTER;
> @ARRAY = ` ls -l /foo/bar | grep "$FILTER" `;
> for (
Awards wrote:
>
> Hi,
Hello,
> I have no idea how to do this.
> I have a name
> Anthony Bob
> I want to put each letter in an array (no space)
> for(0..$numbersofletters){
> @letters[c]= A LETTER
> }
> so when i do print @letters i get
> A
> N
> T
> H
> O
> N
> Y
> B
> O
> B
> something like tha
I'll take this a step further. Search Google for "de icaza .net".
Miguel de Icaza produced the GNOME desktop and founded Ximian/Mono. He's
quoted all over the place discussing what .NET has to offer beyond the MS
arena, for Open Source and wide interoperability. I think that de Icaza
e
John W. Krahn wrote:
> ...
> my @letters = $text =~ /[[:alpha:]]/g;
I never knew you could leave the parens off in a case like this. I just went
and looked it up. Neat!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> my $text = ' Anthony Bob ';
>
> my @letters = $text =~ /[[:alpha:]]/g;
>
> print "$_\n" for @letters;
This works too (at least, works for me):
my $text='Anthony Bob';
my @letters=split(//, $text);
print(join("\n", @letters));
--
Bernhard van Staveren - madcat(at)ghostfield.com
GhostField
> [EMAIL PROTECTED] wrote:
> > Hi All,
> >
> > I want to read contents of a dir, filtered, into a hash. I
> have this:
> >
> > #/usr/local/bin -w
> > use strict;
> > my (@ARRAY, %TEST, $FILTER) = "";
> >
You may want to make sure $FILTER isn't anythign harmful here:
For instance what if Someo
Hello all,
I want a variable to be memoized, that is, keep the variable available only
to the function and the value remembered across invocations. So far, I
have created two versions listed below, both of which "work." The first
version prints a warning message 'Variable "$bar" will not stay s
Very interesting reading, Thanks,
Actually, it "Could be" great reading to "Sleep by". But I have a
concern about all of this, be that a MS "Controlled" .NET or even an
"OPEN source" Mono. Who is going to "control" where all of this resides?
Let's take the MS idea of .NET for a moment, remember
Robert Citek wrote:
>
> Hello all,
Hello,
> I want a variable to be memoized, that is, keep the variable available only
> to the function and the value remembered across invocations. So far, I
> have created two versions listed below, both of which "work." The first
> version prints a warning
Linux Rocks wrote:
>
> Hi All,
Hello,
> I want to read contents of a dir, filtered, into a hash. I have this:
>
> #/usr/local/bin -w
^^
I see no 'perl' there.
> use strict;
> my (@ARRAY, %TEST, $FILTER) = "";
Why are you assigning "" to the first element of @ARRAY?
> print
Hi List
I was wandering if someone can help me out in displaying database data in a
TK window.
I have tried a number of ways but I am loosing memory eventually.. I vet all
"my"'s are not really mine..
All I need to do is fetch from a database and display it In a GUI based
window.
Or some ones has
At 04:18 PM 8/18/2003 -0700, John W. Krahn wrote:
> ... it looks like you want a closure instead.
>
>{ # limit scope of $bar
>my $bar = 100;
>sub foo { ++$bar }
>}
Thanks for the example. I quess I do want closure. I'm not clear on how
closure differs from memoizing. Regardless, this worked e
Samuel Shankar wrote:
Hi List
I was wandering if someone can help me out in displaying database data in a
TK window.
please wander a little more, on google if you are looking for readymade
script
I have tried a number of ways but I am loosing memory eventually.. I vet all
"my"'s are not really m
Sorry for not posting it in the first place.
Will this sub.. chew memory if I run it a number of times.. or does it
overwrite it.
sub read {
print "\nreading data";
$db = DBI->connect("DBI:mysql:$dbase:$hostname", $username, $password);
$query = $db->prepare("SELECT * FROM cash where f1 = '1002'
77 matches
Mail list logo