![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Simple regex problem? | muay_tb | Shell Programming and Scripting | 1 | 03-31-2009 10:49 PM |
| Simple Add - Problem | niceboykunal123 | Shell Programming and Scripting | 5 | 08-19-2008 05:42 AM |
| Simple script problem | FiniteRed | Shell Programming and Scripting | 6 | 08-01-2008 12:15 PM |
| Simple multiplication problem | greekozz | UNIX for Dummies Questions & Answers | 8 | 07-06-2007 10:32 AM |
| Simple ksh script problem | Warrior232 | Shell Programming and Scripting | 14 | 09-10-2005 12:11 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Perl - problem with CPAN module XML::Simple
Hi All,
I am trying to run the following program Code:
#!/usr/bin/perl
# use module
use XML::Simple;
use Data::Dumper;
# create object
$xml = new XML::Simple;
# read XML file
$data = $xml->XMLin("dump.xml");
# print output
print Dumper($dump);
Code:
Can't locate object method "new" via package "XML::Simple" (perhaps you forgot t o load "XML::Simple"?) at dump.pl line 9. Thanks in adavance Last edited by Yogesh Sawant; 05-14-2009 at 02:01 AM.. Reason: added code tags |
|
||||
|
Thanks all for your replies.
I installed Simple.pm on my machine. I have the admin rights on my desktop. I used the command yogesh mentioned. For the options i didnt know answers to, i just ressed enter. Finally i got commit: wrote C:\Perl\lib\CPAN\Config.pm I'm thinking it means that it is installed I also used the command that yogesh mentioned to check if it is installed. I got the following C:\>perl -e 'use XML::Simple;' Can't find string terminator "'" anywhere before EOF at -e line 1. C:\>perl -e "use XML::Simple;" C:\> I changed single quotes to double quotes and then it went to the prompt again. So i'm guessing all is OK. I tried running my program again and the error is the same Can't locate object method "new" via package "XML::Simple" (perhaps you forgot t o load "XML::Simple"?) at dump.pl line 9. Dont know what i missed now. Appreciate help. |
|
||||
|
grouptags
Hi All,
My issue is resolved. I used ratlperl instead of perl and it resolved my problem. Thanks for all ur help. I have redirected the output of my file to output.xm which is in the following format RT => { 'List' => { 'String' => [abcd efgh ] RT! => { 'List' => { 'String' => [ pqrs lmno ] I am trying to get the String values under RT and here is the code i am using my $data = XMLin("output.xml", GroupTags=>{RequestedTerminations=>'String'}); # print output print Dumper($data); However, it doesnt seem to work and i get the following error Undefined subroutine &main::XMLin called at dump.pl line 15. Appreciate your help with this |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|