Hi,
I want to capture UNBUFFERED output from a C programme and then
control it depending on its output. Problem is nothing seems to
unbufferd the output from the C programme. Only when the child has
finished executing do I get all the output which is too late.
The C programe is just like hel
John W. Krahn wrote:
Brian wrote:
my @pages = (
"lc1",
"lc2/",
"lc3/index.html",
"lc4/",
"lc5",
);
map {s/(some regex here)/$1\//} @pages;
$ perl -le'
my @pages = (
"lc1",
"lc2/",
"lc3/index.html",
"lc4/",
"lc5",
);
print "@pages";
s|(?
$ perl -le'
my @pages = (
"lc1",
"
Brian wrote:
Hi all.
Hello,
I think this should be relatively simple but i just can't figure it
out. I have a list of files and directories. The files will all end in
.html. All the remaining elements in the list are assumed to be
directories. I'm looking for a regex to add a trailing slash t
> "APK" == Akhthar Parvez K writes:
APK> 1) Since a hash defined in the main part (outside the
APK> subroutines) of a program can be accessed from anywhere (from all
APK> subroutines), is it fine, in regards to security or even code
APK> elegancy, if we define a hash in the main part?
Hello,
Just want to ensure my understanding about Perl basics is solid. In order to do
that, I have a few questions to be cleared up front.
1) Since a hash defined in the main part (outside the subroutines) of a program
can be accessed from anywhere (from all subroutines), is it fine, in regard
On 10-05-12 04:15 PM, Brian wrote:
Hi all. I think this should be relatively simple but i just can't figure it
out. I have a list of files and directories. The files will all end in .html.
All the remaining elements in the list are assumed to be directories. I'm
looking for a regex to add a tr
Hi all. I think this should be relatively simple but i just can't figure it
out. I have a list of files and directories. The files will all end in .html.
All the remaining elements in the list are assumed to be directories. I'm
looking for a regex to add a trailing slash to the directories if on
Hi,
> You put an escape character '\' (no quote) to point to another hash
> (what follows / symbol, to be more precise). It's known as
> (hash/array/code) references.
>
> my %stp_dirs = ('mvb' => \%mvb_dirs,
> 'pkv' => \%pkv_dirs,
> 'av' =>
HACKER Nora asked:
> Thanks for your explanation and the reference to perldoc, I understand
> now. But it doesn't work yet, I still get the same error. I have
> altered my source now as follows:
>
> my %stp_dirs = ( "mvb" => "\%mvb_dirs",
> "pkv" => "\%pkv_di
On Wednesday 12 May 2010, HACKER Nora wrote:
> Thanks for your explanation and the reference to perldoc, I understand now.
> But it doesn't work yet, I still get the same error. I have altered my source
> now as follows:
>
> my %stp_dirs = ( "mvb" => "\%mvb_dirs",
>
Hi Nora,
On Wednesday 12 May 2010, HACKER Nora wrote:
> > while ( my($sdir,$tdir) = each %{$stp_dirs{'mvb'}}) {
> > print("SourceDir: $sdir\t\tTargetDir: $tdir\n");
> > }
>
> Is that 'mvb' intentional? Also, I don't understand why to put '\%' in front
> of the values from the master hash.
Hi Thomas,
> If you "use strict;" you may not use symbolic references, i.e. (mis)use
> a variable's name to create a reference to it. That's why I fixed your
> code
> by replacing the variable names with references to the variable I
> assumed you'd wish to address.
>
> Maybe you should take a loo
HACKER Nora asked:
> > Try:
> >
> > my %stp_dirs = ('mvb' => \%mvb_dirs,
> > 'pkv' => \%pkv_dirs,
> > 'av' => \%av_dirs,
> > 'be' => \%be_dirs,
> > 'vvw' => \%vvw_dirs );
> >
> > while ( my($sdir,$tdir) = each %{$s
Hi Thomas,
> Try:
>
> my %stp_dirs = ( 'mvb' => \%mvb_dirs,
> 'pkv' => \%pkv_dirs,
> 'av' => \%av_dirs,
> 'be' => \%be_dirs,
> 'vvw' => \%vvw_dirs );
>
> while ( my($sdir,$tdir) = each %{$stp_dirs{'mvb'}}
HACKER Nora wrote:
> The script is being started with a parameter $stp (among others) that
> can be one of mvb/pkv/av/be/vvw. This parameter is used as a key for a
> master hash the values of which are names of other hashes themselves.
>
> # Master-Hash
> my %stp_dirs = ( "mvb" => "mvb_dirs",
>
Hello,
Following the suggestion of one of you (sorry, don't remember who's...),
I am skimming through my old Perl scripts and trying to improve them.
Now I have a problem with one of them, after inserting "use strict;" -
would be great, if you could help me:
The script is being started with a par
On May 11, 12:56 am, weizhong@gmail.com (Weizhong Dai) wrote:
> Hi all,
>
> -
> $pid = open(README, "program arguments |") or die "Couldn't fork: $!\n";
> while () {
> # ...}
>
> close(README)
> --
>
> my problem is: I read fr
17 matches
Mail list logo