460 Posted Topics
Re: See if anything helps you: [url]http://perldoc.perl.org/perlipc.html[/url] | |
Re: [CODE]#!/usr/bin/perl use strict; use warnings; open(IN, '<',"dna.dat") or die "Can't read file\n $!"; my $first_line = <IN>; my $dna = ''; while(my $line=<IN>){ chomp $line; $dna .= $line; } close IN; my $cdna = ''; for my $i (0 .. length($dna)-1){ $_ = substr($dna, $i, 1); if (!/[TAGC]/) {die "Unkown … | |
Re: tr/// only replaces characters for characters (transliteration). It is very limited but faster than s/// for simple character replacing. s/// is a full blown regexp that can use all of perls various options for pattern matching and substitution. For example if all you wanted to do was replace all A's … | |
Re: I don't think that has anything to do with the daniweb website. | |
Re: It may seem strange to you, but thats because you don't understand what is happening. Whenever you send anything in the system array to a sub routine or function the list becomes "flattened". This means that where one list ends and another begins is lost, and it becomes one long … | |
Re: maybe you need to use an array instead of a scalar for capturing the reults: my[B] @result [/B]= $t->cmd(("grep - $filename.txt~ | wc -l | awk '{print $1}'")); | |
The amount, size, placement, and etc, of advertisements on the pages is getting a bit obnoxious (one ad that scrolled across the screen was very obnoxious). I understand the need and the desire for advertising, but the pages are starting to look like billboards with some content thrown in instead … | |
Re: jemather, the code you posted shouldn't even produce values for the scalars in the $sql scalar. [code]('".$title1."', '".$format1."', ".$r_date1.")"[/code] there are no $title1 or $format1 or $date1 scalars defined in the code you posted. You have $title and $format and $r_date. with the correct scalars, the line is better written … | |
Re: [QUOTE]Likewise[/QUOTE] this thread is from 2005, hopefully Shon05 has his program done by now. ;) | |
![]() | Re: why can't you use the system() function or qx// or backtiks? You can look into the Term::Readkey module which I have never used but maybe it can do what you want. You would most likely have to install it though. [url]http://search.cpan.org/~jstowe/TermReadKey-2.30/ReadKey.pm[/url] |
Re: hehehe... the forum moderator letting the forum members (at least the ones that couldn't figure it out) know how to defeat the file attachment restrictions. :) As you can see, it's not a very sophisticated MIME checking routine. :D | |
![]() | Re: maybe the expect module is what you need: [url]http://search.cpan.org/~rgiersig/Expect-1.20/Expect.pod[/url] but you need to use Cygwin. See the above link. ![]() |
Re: technically, as far as I know, it is OK. In general I would say it's not good practice unless it's clear why you needed to do that or put comments in the code explaining why you are doing that. Like in the CGI module you will see a sub routine … | |
Re: that really looks like query string data, in which case the CGI module could be used to get you name value pairs into your script for further use. | |
Re: windows does not read/use the shebang line. I don't tknow what the work-around would be for this problem. It works with the http server (apache at leat) because apache for windows does some kind of unix/shebang line emulation. | |
Re: Do you mean you want the perl code embedded in the html code (sort of like php)? Search google for: "embedded perl" | |
Re: If you are running windows you want to install activestate perl [url]http://www.activestate.com/Products/ActivePerl/?mp=1[/url] this article might help but I don't know which version of apache the article is written for: [url]http://www.thesitewizard.com/archive/addcgitoapache.shtml[/url] | |
Re: you might want to post that question on the perlmonks site to get answers. | |
Re: this should be in the shell scripting forum: [url]http://www.daniweb.com/techtalkforums/forum113.html[/url] | |
Re: [url]http://learn.perl.org/library/beginning_perl/[/url] search google for more perl tutorials and references on the internet | |
Re: look into the Win32 family of modules for doing things in windows with perl. probably Win32::Process | |
Re: some of perls native functions are also meant for Unix, such as flock() and chmod() and some functions might return a different value depending on the operating system, like stat(). | |
Re: no host supports chmoding files externally. You have to connect to the server somehow: telnet/shell, FTP, another script, to change permission of files on a server. | |
![]() | Re: if the file isn't too big this might do what you want: [code] open(FH,'file.txt'); my $data = do {local $/; <FH>}; my @data = split(/\|\|\|/,$data); print "$_\n" for @data; [/code] |
Re: [QUOTE=Mushy-pea;275340]Hello everyone. I've run into a problem with regular expressions; the extraction "variables" ($1, $2, $3 etc.) are read only and scoped to the current block. If you need to do two regex extraction operations in the same block, is there a way to reset the ($1, $2, $3 etc.) … | |
Re: you're using the wrong brackets on your hash keys, you use {} not () [CODE]sub test_function { my($key, %table); %table = ('word1', 'Perl', 'word2', 'is', 'word3', 'great'); $key = "word3"; print $table{'word1'}; print $table{"word2"}; print $table{$key}; }[/CODE] not sure what tutorials you have read but if they are telling you … | |
Re: look intot these operators/functions and decide which is best for your purposes: system - runs a program but doesn't return program output to the perl script. Returns exit status, if any, of run program instead. exec - runs a program but exits the perl program as soon as it's called … |
The End.