Re: removing single quotation marks from a string ?

2006-11-16 Thread Gregory Machin
Hi I'm still not getting the result i require please could someone have a quick look and see what i'm missing ... the following code is suposed to break up the looked info from dns server so I can manipulate it. It dies with the following errors when it reads more than one line from the database

Re: Some array ref qns..

2006-11-16 Thread John W. Krahn
John W. Krahn wrote: > [EMAIL PROTECTED] wrote: > >>'m trying to parse a simple xml document as below.. >> >> >> >>#!/usr/bin/perl -w >>use strict; >># use module >> >>use XML::Simple; >>use Data::Dumper; >> >># create object >>my $config = XMLin('data.xml'); >> >># print output >>#print D

Re: Some array ref qns..

2006-11-16 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > Hi all, Hello, > 'm trying to parse a simple xml document as below.. > > > > #!/usr/bin/perl -w > use strict; > # use module > > use XML::Simple; > use Data::Dumper; > > # create object > my $config = XMLin('data.xml'); > > # print output > #print Dumper($

Some array ref qns..

2006-11-16 Thread bkajey
Hi all, 'm trying to parse a simple xml document as below.. #!/usr/bin/perl -w use strict; # use module use XML::Simple; use Data::Dumper; # create object my $config = XMLin('data.xml'); # print output #print Dumper($config); # access XML data foreach $e (@{$config->{employee}}) {

Re: Database entries into a hash or array

2006-11-16 Thread Mathew Snyder
I'm actually working on that now :D Mathew Roman wrote: > Wouldn't it be better to filter the result with the sql statement? Instead > of doing it in perl. > > > -Original Message- > From: Mathew Snyder [mailto:[EMAIL PROTECTED] > Sent: Thursday, 16 November 2006 4:53 PM > To: John W.

RE: Database entries into a hash or array

2006-11-16 Thread Roman
Wouldn't it be better to filter the result with the sql statement? Instead of doing it in perl. -Original Message- From: Mathew Snyder [mailto:[EMAIL PROTECTED] Sent: Thursday, 16 November 2006 4:53 PM To: John W. Krahn Cc: Perl Beginners Subject: Re: Database entries into a hash or arra

Re: Perl - Joining of Binary values

2006-11-16 Thread Dharshana Eswaran
On 11/17/06, Dr.Ruud <[EMAIL PROTECTED]> wrote: "Dr.Ruud" schreef: > my $data = join("\n", map {sprintf "%08b", $_} > map hex, =~ /[[:xdigit:]]+/g) . "\n" ; > > 1 while $data =~ s/(.+?)(.{7}\n.*)/$2$1/ ; Better: my $data = join "\n", map {sprintf "%08b", $_}

Hi all, can we read or delete multi-lines from Listbox widget?

2006-11-16 Thread 辉 王
Hi all, Can we read or delete multi-lines from Listbox widget? If not, what widget can do it? Text? If it can, how to do it? Please help me. I waste a lot of time and can't figure it out. Thanks. Hui Wang. ---

Re: Perl - Joining of Binary values

2006-11-16 Thread Dr.Ruud
"Dr.Ruud" schreef: > my $data = join("\n", map {sprintf "%08b", $_} > map hex, =~ /[[:xdigit:]]+/g) . "\n" ; > > 1 while $data =~ s/(.+?)(.{7}\n.*)/$2$1/ ; Better: my $data = join "\n", map {sprintf "%08b", $_} map hex, =~ /[[:xdigit:]]+/g

Re: Perl - Joining of Binary values

2006-11-16 Thread Dr.Ruud
"Dharshana Eswaran" schreef: > The input is "31","59", "4C","15","53","DD","54","31" > > The above input is represented as shown below: > 00110001 01011001 01001100 00010101 01010011 11011101 01010100 > 00110001 > > The correction in the desired output is > > 0110001 > 0110010 > 0110001 > 010

Re: Perl - Joining of Binary values

2006-11-16 Thread Dharshana Eswaran
On 11/17/06, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: On 11/17/06, Rob Dixon <[EMAIL PROTECTED]> wrote: > > Dharshana Eswaran wrote: > > > > On 11/16/06, Rob Dixon <[EMAIL PROTECTED] > wrote: > >> > Dharshana Eswaran wrote: > > > > I am working on the code below: > > > >>

Re: Perl - Joining of Binary values

2006-11-16 Thread Dharshana Eswaran
On 11/17/06, Rob Dixon <[EMAIL PROTECTED]> wrote: Dharshana Eswaran wrote: > > On 11/16/06, Rob Dixon <[EMAIL PROTECTED]> wrote: >> Dharshana Eswaran wrote: > > I am working on the code below: > > my @hex = ("14", "2a", "11", "83"); > $hex_length = @hex; > > for(

Re: How to check if a mount point exists.

2006-11-16 Thread John W. Krahn
Ravi Malghan wrote: > Hi: I writing some logs into a directory which is mounted. > >>df -k > 199.11.255.50:/vol/rawdata > 335544320 18471160 317073160 6%/actuate/rawdata > > Is there a way to check within perl if the mount point exists before I write? if ( -e '/actu

How to check if a mount point exists.

2006-11-16 Thread Ravi Malghan
Hi: I writing some logs into a directory which is mounted. >df -k 199.11.255.50:/vol/rawdata 335544320 18471160 317073160 6%/actuate/rawdata > Is there a way to check within perl if the mount point exists before I write? Thanks ray -- To unsubscribe, e-mail: [EMA

Re: subroutine call makes foreach exit?

2006-11-16 Thread John W. Krahn
Andy Greenwood wrote: > I'm writing a script for work that will dig for DNS records for a > given domain name and put the entries into an array. At the end of the > digging, it outputs the array elements to the screen, asks if > everything looks good, and if so, writes them out to the shell and > b

Re: Perl - Joining of Binary values

2006-11-16 Thread Rob Dixon
Dharshana Eswaran wrote: On 11/16/06, Rob Dixon <[EMAIL PROTECTED]> wrote: Dharshana Eswaran wrote: I am working on the code below: my @hex = ("14", "2a", "11", "83"); $hex_length = @hex; for($i=0; $i<$hex_length; $i++) { my $binary = unpack 'B*', pack 'H*', $hex[$i]; print "$binary\n\n

Perl - Joining of Binary values

2006-11-16 Thread Dharshana Eswaran
On 11/16/06, Rob Dixon <[EMAIL PROTECTED]> wrote: Dharshana Eswaran wrote: > > On 11/16/06, Rob Dixon <[EMAIL PROTECTED] > wrote: >> >> Dharshana Eswaran wrote: >>> >>> I am working on the code below: >>> [snip irrelevancies] >>> >>> my @hex = ("14", "2a", "11", "83"); >>> $hex_length = @hex; >>

Re: Perl - Joining of Binary values

2006-11-16 Thread Dharshana Eswaran
Thanks Jay. I will keep Perl on my system, up to date. Thanks and Regards, Dharshana On 11/16/06, Jay Savage <[EMAIL PROTECTED]> wrote: On 11/16/06, Rob Dixon <[EMAIL PROTECTED]> wrote: > Dharshana Eswaran wrote: [snip] > > my @fields = unpack '(A7)*', $binary; > > > > When i tried compiling,

Re: Question on an error I keep receiving...

2006-11-16 Thread Tom Phoenix
On 11/14/06, Phil Strack <[EMAIL PROTECTED]> wrote: I'm very new to Perl and teaching myself...Running ActiveState port on Windows Server 2003 version 5.8.8 build: 819. panic: utf16_to_utf8: odd bytelen blah, blah, blah.. Does it really say "blah, blah, blah.."? Hm. In any case, this is a "

Re: Perl - Joining of Binary values

2006-11-16 Thread Jay Savage
On 11/16/06, Rob Dixon <[EMAIL PROTECTED]> wrote: Dharshana Eswaran wrote: [snip] > my @fields = unpack '(A7)*', $binary; > > When i tried compiling, it says that > > "Invalid type in unpack: '(' at line 10." > > It does not accept this, i tried other combinations too. But it does not > compile

Re: Perl - Joining of Binary values

2006-11-16 Thread Dharshana Eswaran
On 11/16/06, Rob Dixon <[EMAIL PROTECTED]> wrote: Dharshana Eswaran wrote: > > On 11/16/06, Rob Dixon <[EMAIL PROTECTED]> wrote: >> >> Dharshana Eswaran wrote: >>> >>> I am working on the code below: >>> [snip irrelevancies] >>> >>> my @hex = ("14", "2a", "11", "83"); >>> $hex_length = @hex; >>>

Re: Perl - Joining of Binary values

2006-11-16 Thread Rob Dixon
Dharshana Eswaran wrote: On 11/16/06, Rob Dixon <[EMAIL PROTECTED]> wrote: Dharshana Eswaran wrote: I am working on the code below: [snip irrelevancies] my @hex = ("14", "2a", "11", "83"); $hex_length = @hex; for($i=0; $i<$hex_length; $i++) { my $binary = unpack 'B*', pack 'H*', $hex[$

Re: subroutine call makes foreach exit?

2006-11-16 Thread Tom Phoenix
On 11/16/06, Andy Greenwood <[EMAIL PROTECTED]> wrote: if (/^$domain.+MX\s+(\d+)\s+(.+)/) { Because $domain is a string (and not a pattern), interpolating it into a pattern could cause troubles. First, any metacharacters it contains may affect the match. But also, is that pattern going

Re: Perl - Joining of Binary values

2006-11-16 Thread Dharshana Eswaran
Rob, my @fields = unpack '(A7)*', $binary; When i tried compiling, it says that "Invalid type in unpack: '(' at line 10." It does not accept this, i tried other combinations too. But it does not compile the program. What should i do? Thanks and Regards, Dharshana On 11/16/06, Rob Dixon <[E

Re: subroutine call makes foreach exit?

2006-11-16 Thread Andy Greenwood
On 11/16/06, Jay Savage <[EMAIL PROTECTED]> wrote: On 11/16/06, Andy Greenwood <[EMAIL PROTECTED]> wrote: > I'm writing a script for work that will dig for DNS records for a > given domain name and put the entries into an array. At the end of the > digging, it outputs the array elements to the sc

Re: subroutine call makes foreach exit?

2006-11-16 Thread Jay Savage
On 11/16/06, Andy Greenwood <[EMAIL PROTECTED]> wrote: I'm writing a script for work that will dig for DNS records for a given domain name and put the entries into an array. At the end of the digging, it outputs the array elements to the screen, asks if everything looks good, and if so, writes th

Question on an error I keep receiving...

2006-11-16 Thread Phil Strack
Hi I'm very new to Perl and teaching myself...Running ActiveState port on Windows Server 2003 version 5.8.8 build: 819. I'm writing some very simple scripts to return basic numerical values for learning purposes and keep receiving the below error: panic: utf16_to_utf8: odd bytelen blah, blah

subroutine call makes foreach exit?

2006-11-16 Thread Andy Greenwood
I'm writing a script for work that will dig for DNS records for a given domain name and put the entries into an array. At the end of the digging, it outputs the array elements to the screen, asks if everything looks good, and if so, writes them out to the shell and builds a zone file. However, I'v

Re: Perl - Joining of Binary values

2006-11-16 Thread Rob Dixon
Dharshana Eswaran wrote: Hi all, I am working on the code below: use strict; use warnings; my %TypeofNumber = ( '00' => Integer, '01' => Floating, '10' => Char, '11' => Double ); my @hex = ("14", "2a", "11", "83"); $hex_length = @hex; for($i=0; $i<$hex_length; $i++) { my $binary = unpa

Perl - Joining of Binary values

2006-11-16 Thread Dharshana Eswaran
Hi all, I am working on the code below: use strict; use warnings; my %TypeofNumber = ( '00' => Integer, '01' => Floating, '10' => Char, '11' => Double ); my @hex = ("14", "2a", "11", "83"); $hex_length = @hex; for($i=0; $i<$hex_length; $i++) { my $binary = unpack 'B*', pack 'H*', $hex[$

Re: removing single quotation marks from a string ?

2006-11-16 Thread John W. Krahn
Gregory Machin wrote: > Hi Hello, > I need to remove all the quotation marks from, a string > I tried s/\'// but it did not work. > what have i missed ?? You need to use the /g (global) option: s/'//g Or better yet, use the tr/// operator: tr/'//d John -- Perl isn't a toolbox, but a smal

removing single quotation marks from a string ?

2006-11-16 Thread Gregory Machin
Hi I need to remove all the quotation marks from, a string I tried s/\'// but it did not work. what have i missed ?? Many Thanks -- Gregory Machin [EMAIL PROTECTED] www.linuxpro.co.za -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]