Search Results

Search found 10620 results on 425 pages for 'perl module'.

Page 15/425 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • perl equivalent to awk /text/,/END/

    - by kSiR
    I am looking to replace a nasty shell script that uses awk to trim down some html, problem is I cannot find anything in perl that does the aforementioned function awk '/<TABLE\ WIDTH\=\"100\%\" BORDER\=1\ CELLSPACING\=0><TR\ class\=\"tabhead\"><TH>State<\/TH>/,/END/' How can I do this in perl?

    Read the article

  • Perl script -need some help.

    - by benjamin button
    I have an sql file which will give me an output like below: 10|1 10|2 10|3 11|2 11|4 . . . I am using this in a perl script like below: my @tmp_cycledef = `sqlplus -s $connstr \@DLCycleState.sql`; after this above statement,since tmp_cycledef has all the output of the sql query i want to show the output as: 10 1,2,3 11 2,4 how could i do this using perl?

    Read the article

  • Learning Perl, what to code in?

    - by Befall
    Hey all, I've got a few books and helpful guides to Perl from my company's scripting guy, but I can't seem to find where the best IDE for Perl is. Mind you, simple is better. I'm just learning for now. Thanks in advance!

    Read the article

  • SIMPLE file reading in Perl

    - by Befall
    Hey guys, The other answered questions were a bit complicated for me, as I'm extremely new to using Perl. I'm curious how Perl reads in the files, how to tell it to advance to the next line in the text file, and how to make it read all lines in the .txt file until, for example, it reaches item "banana". Any and all help would be appreciated, thanks!

    Read the article

  • Equivalent of libwww-perl in .NET or Java

    - by voidvector
    I have written a crawler in Perl awhile back and it was super simple giving the high-level capability of libwww-perl. It is so straight forward in fact, it can take the raw HTML response of one request, and create the next HTTP request for you from the FORMs on that page (as in it will parse the HTML for you). Does anyone know any library like this on .NET or Java? Selenium is out of question because it requires the browser to be open, which we cannot accommodate in our implementation)

    Read the article

  • What is the current state of Perl 6?

    - by Cobalt
    What is the current state of Perl 6, is it production-ready? Where do we stand right now? There are many programmers curious about the current progress of Perl 6. There are also two other topics open on on reddit and http://perlmonks.org/?node_id=835419 about this.

    Read the article

  • XSLT Stylesheet works with a vbs script, but not Perl

    - by user2472274
    I have a program that is essentially a search application, and it exists in both VBScript and Perl form (I'm trying to make an executable with a GUI). Currently the search application outputs an HTML file, and if a section of text in the HTML is longer than twelve lines then it hides anything after that and includes a clickable More... tag. This is done in XSLT and works with VBScript. I literally copied and pasted the stylesheet into the Perl program that I'm using and it does everything right except for the More... tag. Is there any reason why it would be working with the VBScript but not Perl? I'm using XML::LibXSLT in the Perl script, and here is the template that is supposed to be creating the More... tag <xsl:template name="more"> <xsl:param name="text"/> <xsl:param name="row-id"/> <xsl:param name="cycle" select="1"/> <xsl:choose> <xsl:when test="($cycle &gt; 12) and contains($text,'&#13;')"> <span class="show" onclick="showID('SHOW{$row-id}');style.display = 'none';">More...</span> <span class="hidden" id="SHOW{$row-id}"> <xsl:call-template name="highlight"> <xsl:with-param name="text" select="$text"/> </xsl:call-template> </span> </xsl:when> <xsl:when test="contains($text,'&#13;')"> <xsl:call-template name="highlight"> <xsl:with-param name="text" select="substring-before($text,'&#13;')"/> </xsl:call-template> <xsl:text>&#13;</xsl:text> <xsl:call-template name="more"> <xsl:with-param name="text" select="substring-after($text,'&#13;')"/> <xsl:with-param name="row-id" select="$row-id"/> <xsl:with-param name="cycle" select="$cycle + 1"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:call-template name="highlight"> <xsl:with-param name="text" select="$text"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:template>

    Read the article

  • perl sorting an array of hashes

    - by srk
    use strict; my @arr; $arr[0][0]{5} = 16; $arr[0][1]{6} = 11; $arr[0][2]{7} = 25; $arr[0][3]{8} = 31; $arr[0][4]{9} = 16; $arr[0][5]{10} = 17; sort the array based on hash values so this should change to $arr[0][0]{6} = 11; $arr[0][1]{9} = 16; $arr[0][2]{5} = 16; $arr[0][3]{10} = 17; $arr[0][4]{7} = 25; $arr[0][5]{8} = 31; first sort on values in the hash.. when the values are same reverse sort based on keys... Please tell me how to do this.. Thank you

    Read the article

  • No package rrdtool-perl available

    - by Pentium10
    On a CentOS release 5.10 (Final) I am trying to install rrdtool to get RRDs.pm but I have no luck. yum install rrdtool-perl Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * rpmforge: mirror.team-cymru.org Excluding Packages in global exclude list Finished Setting up Install Process No package rrdtool-perl available. Nothing to do I tried also librrds-perl but that was not found either. 2. I tried: yum whatprovides "*/RRDs.pm" Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * rpmforge: mirror.team-cymru.org Excluding Packages in global exclude list Finished cpanel-perl-514-Log-Log4perl-1.37-1.cp1136.x86_64 : CPAN module - Log4j implementation for Perl Repo : installed Matched from: Filename : /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/Log/Log4perl/Appender/RRDs.pm cpanel-perl-514-RRDs-v1.4.7-1.cp1136.x86_64 : CPAN module - unknown Repo : installed Matched from: Filename : /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/x86_64-linux-64int/RRDs.pm then I tried installing but I got: No package cpanel-perl available and the variants (tried with full name, tried both repos listed)

    Read the article

  • Centos 6.3 PERL CGI selinux file read access

    - by Steed
    I have a CGI script called index.cgi It is trying to read a log file called 10.128.0.242.2012.sep.20.downloaded.txt under the path /var/log/trafcount/ It appears that it is being blocked by selinux. The audit log shows something like type=AVC msg=audit(1348158321.873:1472116): avc: denied { read } for pid=11620 comm="index.cgi" name="10.128.0.242.2012.sep.20.downloaded.txt" dev=dm-0 ino=395264 scontext=unconfined_u:system_r:httpd_sys_script_t:s0 tcontext=unconfined_u:object_r:var_log_t:s0 tclass=file How can I allow this script full access to all files under /var/log/trafcount ?

    Read the article

  • Need help on awk/sed/ perl pattern with regex / grep

    - by Jayakumar K
    Sample file output from grep file1:my $dbh = DBI->connect("dbi:mysql:$database_name", $DB_USER, $DB_PASSWD) file2:($dbc,$rc) = mysql_connect($mysql_host,$mysql_user,$mysql_password); The awk pattern should get values databasename, DB_USER And DB_PASSWD from line 1 and mysql_host,mysql_user and mysql_password from line 2 i.e all variables inside the function. Then it should search for the declaration of that variable in file before : (semicolon) ex: databasename in file1 may be $databasename = "dbweb" ; ex: mysql_user in file2 may be $mysql_user="root" ; Result: It should display variable declarations of all 6 variables along with filenames file2:$mysql_host = "db1"; file2:$mysql_user = "root"; file1:$DB_USER = 'user';

    Read the article

  • perl + shell script + remove all not uniq lines except the first line uniq (FILE NAME) + perl in she

    - by yael
    hi I have the following file How to remove by sed all FILE NAME lines except the first uniq FILE NAME For example need to remove all FILE NAME lines from the file except the first: FILE NAME: /dir1/dir2/dir3/dir4/dir5/file FILE NAME: /dirA/dirB/dirC/dirD/dirE/file the file: FILE NAME: /dir1/dir2/dir3/dir4/dir5/file PARAMETER NAME: blablabla TARGET FILE: 12 SOURCE FILE: 565 FILE NAME: /dir1/dir2/dir3/dir4/dir5/file PARAMETER NAME: blablabla TARGET FILE: 18 SOURCE FILE: 552 FILE NAME: /dir1/dir2/dir3/dir4/dir5/file PARAMETER NAME: blablabla TARGET FILE: 14 SOURCE FILE: 559 FILE NAME: /dirA/dirB/dirC/dirD/dirE/file PARAMETER NAME: blablabla TARGET FILE: 134 SOURCE FILE: 344 FILE NAME: /dirA/dirB/dirC/dirD/dirE/file PARAMETER NAME: blablabla TARGET FILE: 13 SOURCE FILE: 445 FILE NAME: /dirA/dirB/dirC/dirD/dirE/file PARAMETER NAME: blablabla TARGET FILE: 13

    Read the article

  • what might cause a print error in perl?

    - by Mark J Seger
    I have a long running script that every hour opens a file, prints to it and closes the file. I've recently found very rarely, the print is failing, not because I'm testing the status of the print itself but rather due to the fact of missing entries in the file until the system is actually rebooted! I do trap for file open failures and write a message to syslog when that happens and I'm not seeing any open failures so I'm now guessing it may be the print that is failing. I'm not trapping the print failures, which I suspect most people don't but am now going to update that one print. Meanwhile, my question is does anyone know what types of situations could cause a print statement to fail when there is plenty of disk storage and no contention for a file which has been successfully opened in append mode?

    Read the article

  • reinstall PHP as apache module

    - by Ewan
    Hi sorry for the newbie question, I am not a sys admin by any means. I recently set up a VPS with webmin/virtualmin. Our CMS of choice says that PHP needs to be run as an Apache module in order to run. It says: Recompile PHP with the flag --with-apxs I've googled but can't find how to do this particularly. I think I installed PHP using "yum install php" or thru webmin, but can't remember exactly. Appreciate if anyone can point me in the right direction.

    Read the article

  • How do I make a shortcut for a Perl program under Windows using a DOS batch file?

    - by Micah
    I'm trying to "hide" some of my perl program from the end user to make things easier on them. I'm doing what I can to keep them out of the command prompt. The program itself has a GUI designed in Perl/Tk, so they don't have to worry about the command prompt. Could I write out a quick batch file that goes along the lines of: START perl 'C:\[some path here]\myscript.pl' with START to start a program, the perl interpretor as my program, and the path/name of my perl script as the parameter? Would I have to specify where to find perl or would Windows just know because perl is in the computer's PATH variable? Thanks for the help!

    Read the article

  • Making a shortcut for a Perl program under Windows using a DOS batch file.

    - by Micah
    I'm trying to "hide" some of my perl program from the end user to make things easier on them. I'm doing what I can to keep them out of the command prompt. The program itself has a GUI designed in Perl/Tk, so they don't have to worry about the command prompt. Could I write out a quick batch file that goes along the lines of: START perl 'C:\[some path here]\myscript.pl' with START to start a program, the perl interpretor as my program, and the path/name of my perl script as the parameter? Would I have to specify where to find perl or would Windows just know because perl is in the computer's PATH variable? Thanks for the help!

    Read the article

  • Do different versions of Perl require different CPAN module installations?

    - by Leonard
    We have a server farm that we are slowly migrating to a new version of Perl (5.12.1). We are currently running 5.8.5. The OS will be upgraded from RedHat 4 to RedHat 5 as well, but RedHat 5 is still back on Perl 5.8.8. Thus for a while in our source tree we'll be supporting two versions of Perl. I have been told to install the new version of Perl into our source tree, and also all of the CPAN modules we currently use. I was actualy told to 'compile' the modules with the correct version of Perl. I'm confused by this. Do some modules actually configure themselves differently for different versions of Perl? Given this, I assume I should configure a CPAN directory for each version of Perl in our tree? Any information or 'gotchas' about this scenario?

    Read the article

  • Perl unpack in list context

    - by drewk
    A common 'Perlism' is generating a list as something to loop over in this form: for($str=~/./g) { print "the next character from \"$str\"=$_\n"; } In this case the global match regex returns a list that is one character in turn from the string $str, and assigns that value to $_ Instead of a regex, split can be used in the same way or 'a'..'z', map, etc. I am investigating unpack to generate a field by field interpretation of a string. I have always found unpack to be less straightforward to the way my brain works, and I have never really dug that deeply into it. As a simple case, I want to generate a list that is one character in each element from a string using unpack (yes -- I know I can do it with split(//,$str) and /./g but I really want to see if unpack can be used this way...) Obviously, I can use a field list for unpack that is unpack("A1" x length($str), $str) but is there some other way that kinda looks like globbing? ie, can I call unpack(some_format,$str) either in list context or in a loop such that unpack will return the next group of character in the format group until $str is exausted? I have read The Perl 5.12 Pack pod and the Perl 5.12 pack tutorial and the Perkmonks tutorial Here is the sample code: #!/usr/bin/perl use warnings; use strict; my $str=join('',('a'..'z', 'A'..'Z')); #the alphabet... $str=~s/(.{1,3})/$1 /g; #...in groups of three print "str=$str\n\n"; for ($str=~/./g) { print "regex: = $_\n"; } for(split(//,$str)) { print "split: \$_=$_\n"; } for(unpack("A1" x length($str), $str)) { print "unpack: \$_=$_\n"; }

    Read the article

  • perl threading problem

    - by Alice Wozownik
    I'm writing a multithreaded website uptime checker in perl, and here is the basic code so far (includes only threading part): !/usr/bin/perl use LWP::UserAgent; use Getopt::Std; use threads; use threads::shared; my $maxthreads :shared = 50; my $threads :shared = 0; print "Website Uptime Checker\n"; my $infilename = $ARGV[0]; chomp($infilename); open(INFILE, $infilename); my $outfilename = $ARGV[1]; chomp($outfilename); open(OUTFILE, "" . $outfilename); OUTFILE-autoflush(1); while ($site = ) { chomp($site); while (1) { if ($threads < $maxthreads) { $threads++; my $thr = threads-create(\&check_site, $site); $thr-detach(); last; } else { sleep(1); } } } while ($threads 0) { sleep(1); } sub check_site { $server = $_[0]; print "$server\n"; $threads--; } It gives an error after a while: Can't call method "detach" on an undefined value at C:\perl\webchecker.pl line 28, line 245. What causes this error? I know it is at detach, but what am I doing wrong in my code? Windows shows lots of free memory, so it should not be the computer running out of memory, this error occurs even if I set $maxthreads as low as 10 or possibly even lower.

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >