Or if this string is stored in a file, and if it is very very big and you
don't want to load it entirely into memory, you could use something like:
{local $/ = "";
open(my $in, "11.txt");
while(<$in>) {
chomp;
print "$_\n";
}
close $in;
}
It is simple to delete the first and last respectively
,
David Moreno Garza 写道:
Jeff Pang wrote:
@EXPORT was used for exporting symbol (methods or variables) by default.
When you say,
use base 'Exporter';
our @EXPORT = qw/&mysub/;
..
then mysub() would be exported into caller's name space defaultly.
Would that also work using:
our @EXPORT = qw/mysu
Jeff Pang wrote:
> @EXPORT was used for exporting symbol (methods or variables) by default.
> When you say,
> use base 'Exporter';
> our @EXPORT = qw/&mysub/;
> ..
> then mysub() would be exported into caller's name space defaultly.
Would that also work using:
our @EXPORT = qw/mysub/; ?
Or is
Michael Goopta wrote:
> I am new to Perl.
>
> How can I split the below string and get the multiple
> web-addresses in a list: (i.e. the strings between
> and
>
> http://view-preprod.admission.net/abc/mactive/_NJMG_0002029003-01/i-1.JPG?t=tr/m:FitPad/w:199/h:124&t=ts/r:199x199http://view-prepro
Jeff Pang wrote:
Paul Johnson 写道:
Jeff Pang wrote:
Ben Edwards 写道:
I am passing a reference to a hash ($publisher) and a array with an
unknown number of elements (@files). So the call is
delete_from_publishers( $publisher, @files )
mnnn,don't pass an original array to a subroutine at a
Hi,
Did you try to use Net::FTP::Recursive
(http://search.cpan.org/~jdlee/Net-FTP-Recursive-2.00/Recursive.pm)
It seems to fit to your task.
Yaron Kahanovitch
- Original Message -
From: "Shu Cho" <[EMAIL PROTECTED]>
To: beginners@perl.org
Sent: Thursday, May 24, 2007 10:26:00 AM (GMT+02
"Dharshana Eswaran" schreef:
> $xyz =~ /\s*(\w+)\s+(\w+);/;
> $b = $2; #variable name is stored here
>
> ...
>
> But the variables like pp_lac[COMMON_TYPE_MAX] and
> pp_plmn_list[COMMON_TYPE_MAX] are not getting stored because of the
> special character used inbetween the names.
The
Hi All,
I am trying to extract strings from few files. The content of the file reads
as shown
typedef struct
{
REFID_T pp_ref_id; /* destination */
CAUSE_T pp_cause;/* Reason registered */
STATE_T pp_state; /* State for indicators */
COMMON_TY
Dharshana Eswaran 写道:
Hi All,
I am trying to extract strings from few files. The content of the file
reads
as shown
typedef struct
{
REFID_T pp_ref_id; /* destination */
CAUSE_T pp_cause;/* Reason registered */
STATE_T pp_state; /* State for i
Paul Johnson 写道:
On Thu, May 24, 2007 at 05:55:13PM +0800, Jeff Pang wrote:
Ben Edwards 写道:
I am passing a reference to a hash ($publisher) and a array with an
unknown number of elements (@files). So the call is
delete_from_publishers( $publisher, @files )
mnnn,don't pass an original array
On Thu, May 24, 2007 at 05:55:13PM +0800, Jeff Pang wrote:
> Ben Edwards 写道:
> >I am passing a reference to a hash ($publisher) and a array with an
> >unknown number of elements (@files). So the call is
> >
> >delete_from_publishers( $publisher, @files )
> >
>
> mnnn,don't pass an original array
Jeff Pang 写道:
Ben Edwards 写道:
I am passing a reference to a hash ($publisher) and a array with an
unknown number of elements (@files). So the call is
delete_from_publishers( $publisher, @files )
mnnn,don't pass an original array to a subroutine at anytime.
Instead just pass a reference to r
Ben Edwards 写道:
I am passing a reference to a hash ($publisher) and a array with an
unknown number of elements (@files). So the call is
delete_from_publishers( $publisher, @files )
mnnn,don't pass an original array to a subroutine at anytime.
Instead just pass a reference to routines.like,
Hi Ben,
You can use shift for this.
sub remove_files_from_ftp_server {
my $pub_detail = shift @_;
my @files = @_;
Thank You,
-srini
Ben Edwards wrote:
I am passing a reference to a hash ($publisher) and a array with an
unknown number of elements (@files). So the call is
delete_from_pu
I am passing a reference to a hash ($publisher) and a array with an
unknown number of elements (@files). So the call is
delete_from_publishers( $publisher, @files )
Currently the beginning of the sub is:-
sub remove_files_from_ftp_server {
my $pub_detail = $_[0];
my $args = @_;
my @fi
Hi list,
I want to upload a directory to a remote FTP server, is there any nice
solution? Here is my script:
#!/usr/bin/perl
use Net::FTP;
use File::Find;
$ftp = Net::FTP->new("host", Port => 1234);
$ftp->login("usr", "passwd");
sub upload_file {
$ftp->mkdir($File::Find::name, 1) if -d;
$ft
16 matches
Mail list logo