Hi I'm looking for a Perl RESTful framework that have to :
work under apache2/mod_perl2
be simple
be elegant
be light
be flexible
Am I just dreaming or can I avoid the 'Roll our own' approach?
What framework would you recommend?
I am doing the below in a perl script:
my @pm1_CS_missing_months = `sqlplus -s $connstr \@DLmissing_months.sql`;
it takes the output of an sql query.
if i have to check for no rows selected,how could i do it?
i want to do like this:
if(no rows selected)
{
do this;
}
i can thought that it will open a shell, execute the parameter (shell command) and return the result in a scalar.
But, execute 'system' function in a perl script is faster than a shell command.
It will call this command in C?
If yes, what's the difference between
rmdir foo
and
system('rmdir foo');
Thanks,
Hi everyone,
I am trying to write a simple Perl CGI script that:
-runs a CLI script
-reads the resulting .out file and converts the data in the file to an HTML table.
Here is some sample data from the .out file:
10.255.202.1 2472327594 1720341
10.255.202.21 2161941840 1484352
10.255.200.0 1642646268 1163742
10.255.200.96 1489876452 1023546
10.255.200.26 1289738466 927513
10.255.202.18 1028316222 706959
10.255.200.36 955477836 703926
Any help would be much appreciated.
-Sebastian
If I have a hash in Perl that contains complete and sequential integer mappings (ie, all keys from from 0 to n are mapped to something), is there a means of converting this to an Array?
I know I could iterate over the key/value pairs and place them into a new array, but something tells me there should be a built-in means of doing this.
What is the best way to achieve sscanf like functionality in perl?
I am looking now looking at the sscanf module,
Which is better,
Option-1: Going sscanf way?
Option-2: Regex way? [I am a beginner when it comes to Regex]
How do I do the following in Perl in order:
a) curl a page and save it to a variable
b) parse the value of the variable (which is HTML content) for values I want (ex: the info is kept between tags like ... )
I am new to any scripting language. But, still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, what is the best online resource to learn Perl?
Is it possible to use a Perl hash in a manner that has O(log(n)) lookup and insertion?
By default, I assume the lookup is O(n) since it's represented by an unsorted list.
I know I could create a data structure to satisfy this (ie, a tree, etc) however, it would be nicer if it was built in and could be used as a normal hash (ie, with %)
So I am trying to read an XML file into a string in Perl and send it as part of a SOAP message. I know this is not ideal as there are methods for SOAP sending files, however, I am limited to having to use the SOAP that is set up, and it is not set up for sending with file support.
Therefore I need to parse out the markup tags < and replace them with []. What is the best way to do this?
I'm looking for a way of mapping a uid (unique number representing a system user) to a user name using Perl.
Please don't suggest greping /etc/passwd :)
In ksh, I'd use
cd /usr/src/sys
How should I write it in Perl? A conversion such as
cd /usr/src/sys ---> chdir '/usr/src/sys'
Maybe the following would be better:
execute "chdir '/usr/src/sys' "
I have a map in perl which has been dumped into from some legacy code the name of the key has now changed from simply reqHdrs to reqHdrs.bla
$rec->{reqHdrs.bla}
My problem is now I cant seem to access this field from the map any ideas ?
The following is my error
Download Script Output: Bareword "reqHdrs" not allowed while "strict subs" in use
How to enable user account in Active Directory from PERL if that account is disabled
I am using NET::LDAP . How its not working UserAccountControl Attribute
I'm looking for good timer implementation in perl. The situation I met is like: I need to keep track of I/O activities of many files and for thoes files keep untouched for enough time a remove action will be taken upon them, so an efficient timer implementation is really vital for
the app I'm involved right now. To avoid recreate the wheel, ask you guys for help first.
All,
I have a hosts file that looks like this:
10.10.10.1 myserver1 myserver1alias
10.10.10.2 myserver2 myserver2alias
I'm looking for a way using perl to pass in an argument of myserver1 and have it return myserver1alias, likewise if I pass in myserver2 it should return myserver2alias. Any suggestions?
I have Perl code:
my $s = "The+quick+brown+fox+jumps+over+the+lazy+dog+that+is+my+dog";
I want to replace every + with space and dog with cat.
I have this regular expression:
$s =~ s/\+(.*)dog/ ${1}cat/g;
But, it only matches the first occurrence of + and last dog.
How do I write Perl objects with extensible code? Im thinking drivers, or some configuation, where the user can pass in a string "Classname::Class" or something. Thanks.
I need perl script to compare line from file1 with file2 and copy to final file, something like this:
File1.txt:
ASPO01
ASPO02
ASPO03
File2.txt:
ASPO01 2013-11-10 19hrs
ASPO10 2013-11-09 24hrs
ASPO02 2013-11-08 10hrs
ASPO16 2013-11-05 9hrs
ASPO17 2013-11-06 6hrs
ASPO03 2013-11-07 15hrs
ASPO18 2013-11-02 25hrs
...
Search into File2 and copy to final file called final.log, like this:
final.txt:
ASPO01 2013-11-10 19hrs
ASPO02 2013-11-08 10hrs
ASPO03 2013-11-07 15hrs
Thanks for all good friends can help me!!!
I have a file containing the following content 1000 line in the following format:
abc def ghi gkl
how to write perl script to convert it into :
abc ghi
??