Jin Zhisong wrote:
> HI, I'm looking for some advice of how to do this?
>
>
>
> I need to match some "variable" pattenrs so
>
>
>
> I define a $match variable and use it in the patterr below.
>
> However it didn't match anything for the sample data.
>
>
>
> If I change the match critia to h
It should work unless the user you are using to run the script doesn't
have the rights to chdir to that directory.
Ravindra Ugaji wrote:
> Hi Monks,
> I am trying the following code to change the directory
>
> chdir ( '/opt/application') || die ("Can't change directory: $!\n");
> tried this also
>
This can be made with a regular expression:
#!/usr/bin/perl
#vim: set shiftwidth=2 autoindent showmatch syntax=perl
use strict;
use warnings;
# all lines following __DATA__ go into $s
my $s;
{ local $/ = undef; $s = ; }
my %vars;
# match 1 or more alphabetics chars followed by an '=' followed
mike re-v wrote:
Note: forwarded message attached.
__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail
Subject:
loop nested foreach
Fr
Trina Espinoza wrote:
Have a question regarding hashes. Lets say I wanted a list as one of
the values in my hash for the reason that I would want to constantly
push values into that list. ..
$dataHash{"$fileName"}{count} = 1;
$dataHash{"$fileName"}{increment} = push(@array,$fileNumber);
###PROBL
It's difficult to answer if you do not post the code with some input to
test it, but lets suppose you have this:
my @array;
@array = ; # slurp whole file
Then is easy to get what you want:
my @lines_with_single_word = grep /^\s*\S+\s*$/,array; # ^\s*\S+\s*$
means beginning of line, 0 or more wh
Look for 'Playing with STDIN and STDOUT' and 'Re-Opening Files (dups)'
in perlopentut .
Wagner, David --- Senior Programmer Analyst --- WGO said the following
on 6/16/2004 2:09 PM:
I have a Perl process which runs on solaris under 5.8.3. It is started with
the following command:
This will do it:
perl -n -e 'print if /Testing/m' test.txt
'-p' prints every line in the file so you'll see the matching lines
twice (one because of '-p' and the other because of 'print') and the
non-matching lines once (because of '-p').
Look in 'perldoc perlrun' for differences on '-p' and '-
[EMAIL PROTECTED] wrote:
$field = "Search, This is part of the code.";
## We need to split by spaces. The issue is that the comma comes along.
local(@words) = split('\s+', $field);
foreach $word (@words) {
if ($word =~ /Search/i) {
$word =~ s/[,\]\)\}]\b//;
$word =~
If you split the line like this:
@seqs=split(/gi|37182815|gb|AY358849.1|/,$seq);
It means the fields are separated by 'gi' or '37182815' or 'gb' or
'AY358849.1'. I don't think this is what you are looking for...
From the previous post, it seems the file is separated by tabs, so
'gi|37182815|gb
Is this what you need?
#!/usr/bin/perl
use strict;
# List of required columns separated by ', ', must match names in 'Fields:'
my $req_fields = shift || 'Subject id, % identity, alignment length,
mismatches, q. start, q. end';
# Split into array
my @req_fields = split /, /, $req_fields;
# Print he
Stephan Hochhaus wrote:
A question I assume can be answered using regexp, unfortunately I am
just starting my way into it. I have a bunch of words that I want to
split, so that the first letters (minus n) and the last n-letters are
seperated.
n is user defined and therefore not static.
How can
PerlDiscuss - Perl Newsgroups and mailing lists wrote:
I'm just a beginner to perl and am having some beginner type problems.
I need to import a external file containing 15 character ID numbers (one
per record) into an single dimensional array within perl. Later this array
will be used to interroga
Werner Otto wrote:
Hi All,
How would I go about calling a sub from a script from another script.
I am trying to call that sub just to get the values in my current
script and then perform aditional logic, other than duplicating the
process?
Is this what you mean?
file1.pl:
#!/usr/bin/perl
use st
Anish Mehta wrote:
Hello Everyone,
I have a problem is getting some data from database. I am getting the
error like this:
Storable binary image v2.6 more recent than I am (v2.4) at
blib/lib/Storable.pm (autosplit into blib/lib/auto/Storable/thaw.al)
line 342,
It seems that the entry at the db
> hi all,
> i hav a requirement wherein i hav to generate array name dynamically
> durin recursive function cal how can i do this .
>
Why do you need to generate an array name? Can't you make it work using
references? Because this way is, by far, less error-prone.
> sid
> --
> hi all,
> can anyone tel me how to look for files which conatain dotsin it.
> i.e
> file1.txt
> file2.txt
> how to check for dots in filename using regular expression.
> is it correct
>
> my $ty=polica.op
> if($ty =m/ (.*)\.o/)
The regular expresion should be /(.*)\.o/. Otherwise you'll tr
[EMAIL PROTECTED] wrote:
ok here it what I did and it is emailing sproadically. Also it is not
placing the array data into the email body???
## Set pragmas
use strict;
use Mail::Sendmail;
## Set and edit variables
my $foreigntapes="/usr/local/log/foreign_tapes.log";
d
rmck wrote:
Hi
I have the .h file of a program that spits out a data file which is Binary Output. The binary file is a series of fixed length records. In C, each record has the format which is in the script.
I thought I could use unpack to read the data, and I am having no success. PLEASE
Robert Citek wrote:
>
> On Saturday, May 29, 2004, at 09:03 US/Central, Roberto Etcheverry
> wrote:
> > The usual way to install modules is to run 'cpan':
>
> Here's a transcript of my cpan search:
>
>
> # perl -MCPAN -e 'shell;'
> Termina
ote:
>
> On Friday, May 28, 2004, at 16:29 US/Central, Roberto Etcheverry wrote:
> > http://search.cpan.org/src/GAAS/HTML-Format-1.23/lib/HTML/FormatText.pm
>
> Thanks. I looked for that tar file and couldn't find one. So, I used
> a wget to download the module:
>
>
Look in search.cpan.org.
Sources are found at
http://search.cpan.org/src/GAAS/HTML-Format-1.23/lib/HTML/FormatText.pm
On Fri, 28 May 2004, Robert Citek wrote:
>
> Hello all,
>
> We are in the process of installing Request Tracker (
> http://www.bestpractical.com/rt/ -- rt.3.0.11 ) on a Fedora bo
On Fri, 28 May 2004, Andrew Gaffney wrote:
> I'm trying to write a regex to parse the following data. Each group is a string
> to parse.
>
> 05/28/04
>
> Purchase With Pin Pin
>
> $10.00(pending) href='javascript: ShowHelp("PENDING TRANSACTION")'> border="0">
> $1,224.45
>
> 05/27/04
>
> Purc
23 matches
Mail list logo