uestions, and a confused one as
that - so apologies if this query is misdirected or, er, not particularly
intelligible :-)
best regards,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--On Montag, 25. Februar 2002 10:24 -0900 Michael Fowler
<[EMAIL PROTECTED]> wrote:
> On Mon, Feb 25, 2002 at 07:45:30PM +0100, Birgit Kellner wrote:
>> for (@array) { # contains a bunch of numbers
>> my %hash = &get_record($_);
>> }
> Are you under the
--On Montag, 25. Februar 2002 10:24 -0900 Michael Fowler
<[EMAIL PROTECTED]> wrote:
> On Mon, Feb 25, 2002 at 07:45:30PM +0100, Birgit Kellner wrote:
>> for (@array) { # contains a bunch of numbers
>> my %hash = &get_record($_);
>> }
> Are you under the
#end while
close DB;
return (%hash);
}
The line commented with "problem" now has the last value of $line from the
subroutine get_record as $_, and no longer the original array element. Can
it be that the subroutine somehow assigns something else to $_ and that
this assignment is the
Many thanks to Michael and the others who responded to this query!
Needless to say: problem solved.
Thanks again,
Birgit Kellner
--On Mittwoch, 06. Februar 2002 17:59 + Michael Lamertz
<[EMAIL PROTECTED]> wrote:
>
> H, did I make sense?
>
> --
>
);
Can I sort the hash on the second element of the anonymous array?
Output should be:
firstvaluetwo
thirdvaluetwo
valuetwoforsecondkey
Many thanks in advance,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
t "QUERY\n-\n$query\n-\n";
$rec{'content'} =~ s/$query/!query!/s;
print "CONTENT AFTER CHANGE: $rec{'content'}\n";
}
Does anyone know why the substitution in the second line from the bottom is
not carried out? Does
u
have to pass a filename to it.
I want to perform this routine on hash values inside a perl script, without
having to write them to a file.
Do you know of any parser that works without files?
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
s for the code, by the way. I think I can use it, even though
there remains one case where it doesn't work:
http://someimagefile.jpg"; alt="A > B">
That is, cases where tag attributes themselves contain pointed brackets
(which is, AFAIK, legal).
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
# prints "Rita 1983! and then some text and here is !Künne 1234! and
#!Kußmaul and 2001"
Why does this not print the following:
Rita and 1983
Künne and 1234
Kußmaul and 2001
And why is the regexp greedy with \C, but not with \w?
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL
I can
switch from firstsetupfile.cgi to secondsetupfile.cgi,
but not back.
Any suggestions? If there's a better way to do this, other than using require's, I'd
be more than glad to learn of it.
Best regards,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
{
my $var = $1;
$string =~ s/$var"/$var'/;}
print qq|$string\n|;
The only case I found so far that it doesn't cover is when tag attributes
themselves contain a ">"-character, like:
http://someimage.gif"; alt="8 > 4">
for images on submit, but isn't there a simpler, perl-ish solution?
--On Donnerstag, 13. Dezember 2001 17:01 +0100 Birgit Kellner
<[EMAIL PROTECTED]> wrote:
> I'm trying to code a routine for uploading up to four images via a
> CGI-form, using CGI.pm.
>
> Filenames incl
nted
print OUTFILE $buffer;}
close ($file);
close (OUTFILE);
print qq|BYTES read: $bytesread|;# no value for $bytesread
}
Suggestions?
Thanks,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
27;s interpolation and for especially \2 could be interpolated.
> If I right remember it's an old version for $2 which have every value.
>
> Try, what happens when you use the q| ... | syntax instead of qq| ... |.
>
Exactly that was the problem! The code works fine with q| ... |.
" for the second?
I thought of adding "\\|\/" in the regexp after "(.*?)", but then the first
image is not extracted at all.
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
just checking whether the server still blocks my mail-server.
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
double
field name as value, and if the hash value of that field name contains
"~~", return an error message.
Anyway, many thanks for the advice,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
undefined\n";
>
Sorry for being stubborn, but I' like to decode multivalued parameters
*without* identifying them by name.
That's precisely why reading multiple values into an array is not
applicable.
Is it possible that, when I do "my %in = $q->Vars" (should be "%i
}
return(%in);
}
Any ideas why the deletion doesn't work in the first "parse_form"
subroutine?
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--On Sonntag, 18. November 2001 17:31 -0900 Michael Fowler
<[EMAIL PROTECTED]> wrote:
> On Fri, Nov 16, 2001 at 10:39:57PM +0100, birgit kellner wrote:
>> How can I filter out strings which contain two (or three) non-identical
>> capital letters in a row?
>>
>
he list
or alternatively, if the item does not occur in the list, enter a new
value. What the parse_form *should* do is ignore names without values from
the start, and not read them into @names and *then* check whether they have
values.
Thanks a lot for any advice,
Birgit Kellner
--
To unsub
How can I filter out strings which contain two (or three) non-identical
capital letters in a row?
my $string1 = "ABCD";
my $string2 = "AbCd";
my $string3 = "AABcD";
Get $string1, discard $string2 and $string2.
Birgit Kellner
--
To unsubscribe, e-mail: [E
ething like:
>
> $item = "35 Main St." (it could also be "35 Main St" in which case I want
> the substitution to happen)
>
> $varS = "st";
> $item =~ s/\b$varS(^.|\W)\b/St./gi;
>
if ($item =~ /\b(st)\b/i) { $item =~ s/$1/St\./g;}
Birgit Kellner
--On Mittwoch, 14. November 2001 09:44 -0800 Wagner-David
<[EMAIL PROTECTED]> wrote:
> So given your new data, I am unsure what data would be placed in the
> hash. From your example, what is expected?
>
> Wags ;)
>
In %Authorhash, a main heading should be assigned to the heading number
(
t;
after the end of that line - if so, assign everything in between the end of
that line and "1\.1\.\s." as a hash value, and move up the counter to 2; if
not, move up the counter to 2 and search for a line beginning with "2\.\s"
*after* "1\.1\.\s". "
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
this necessarily involve slurping the whole file into
an array first?
Thanks in advance for any advice,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--On Donnerstag, 08. November 2001 19:50 -0500 Jeff 'japhy' Pinyan
<[EMAIL PROTECTED]> wrote:
> On Nov 9, birgit kellner said:
>
>> for ($i = 0; $i < @inputarray; $i++) {
>
> You use $i here...
>
> And here. That's bad.
>
> Either use di
\n";#checking
Output:
foo
bat
baz
-
foo
bar
baz
burp
--
identical!
not identical: bat and bar
match b and b
match a and a
relevance: 2
percent of letters in same position: 66.7
100
66.7
RELEVANCE: 83.3
Problem: The loop should g
ame and replace it with $new_file_name, but most links are
relative, and ... well, before I think further along that path, has anyone
else?
Thanks in advance,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
rray[$phone_pos];
}
}
close (FILE);
foreach my $key (keys %city_and_phone) {
print "$key: $city_and_phone{$key}\n";
}
Not tested, but I've been using code like this a lot lately.
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
al {
...
require "$db_setup.cfg";
}
...
#now I can use $db_file_name
Or could/should I use "our" instead of "use vars" for (a) initializing
variables which will then be filled be requiring $db_setup.cfg and/or (b)
initializing variables which will then be expo
(i.e. excluxive or) on strings would
best be done with "xor". Is that correct?
thanks,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--On Freitag, 19. Oktober 2001 12:26 -0700 Luke Bakken
<[EMAIL PROTECTED]> wrote:
> is your umask 022?
>
>
exactly. Thanks to you and Bob for the hint,
Birgit
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
permissions to 777, using the following code, it doesn't
work:
mkpath(["$newdir"], 0, 0777);
Any explanations?
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--On Freitag, 19. Oktober 2001 12:49 -0400 Jeff 'japhy' Pinyan
<[EMAIL PROTECTED]> wrote:
> On Oct 19, birgit kellner said:
>
>> my $header = "Joe DoeThe book I wrote yesterday";
>> my $title;
>> if ($header =~ /(^\S.+)()(\S.+$)/m) { $title
py the value of a variable and then run a regexp
substitution on it; I was wondering whether there's a better approach than
this one.
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
while () {
my @words = split / /;#assumes words in line are separated by a single
space
foreach my $word (@words) {
if ($word =~ /p/) {
print "$word\n";
}
}
}
close (FILE);
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
nal directory
while resetting directory parameters.
I was wondering whether there are any modules for this particular purpose,
or whether anyone has done something similar and can point me to some
relevant resources.
Thanks,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
f $regexp_func[$field] as
its name is called?
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
carry out a search operation and check for duplicate
values in one particular field". I am taking note of simpler large-scale
approaches for eventual future re-coding of the entire script, so your
suggestsion to pass array references rather than arrays has been duly taken
note of. But I cannot implement it at the present stage, due to competence
and also time restrictions.
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
example, that would be "is". I guess the first step to do would be to
separate @hitsarray in sets of four elements (how? loop sliceing?), code
these sets as arrays and check whether $array[$searchposition] of one such
array is identical to that of another. Or is there a more effici
st $delete_last_elements elements\n";
foreach (@searchwords) {print "$_\n";}
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
if ($found == scalar keys %searchhash) {
#when there are as many matches as hash elements, grab the line, otherwise
just move on
push (@hits, \@line);}
}
}
close (FILE);
foreach my $hit (@hits) {
print "HIT: ", join("|", @$hit), "\n";
}
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--On Samstag, 22. September 2001 12:26 -0800 Michael Fowler
<[EMAIL PROTECTED]> wrote:
> On Sat, Sep 22, 2001 at 03:27:01AM +0200, birgit kellner wrote:
>> --On Samstag, 22. September 2001 01:09 +0200 Andrea Holstein
>> > Simple solution is
>> > ...
>> &g
15|vienna
#miller|32|copenhagen
# Neither does it work for:
#somestuff|15|copenhagen
#kellner|15|vienna
#miller|32|copenhagen
#miller|32|copenhagen
#For these two files, I only get one hit back. Any clues?
# Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--On Samstag, 22. September 2001 01:09 +0200 Andrea Holstein
<[EMAIL PROTECTED]> wrote:
> Birgit Kellner wrote:
>>
>> my %hash = ('firstkey' => 'firstvalue',
>> 'secondkey' => 'secondvalue',
>>
y');
my @index_array;
foreach my $element (@array) {
# QUESTION: here I'd like to have some code that returns the index number
of $element, which I'd store in $index
if ($hash{$element}) {
push (@index_array, $index);
}
}
Any su
ANSI characters I am using are not part of one consistent
language specification or covered by one particular code-set. I have to
directly access their values.
I realize that this is probably more of an RTF question, but thought to ask
here first as the RTF-file is generated via a perl module and as there
might just be some steps in perl that I'm missing out on.
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
above code is what I want it to be: the
value for the key "A" from that particular hash to which the scalar $array
refers - it would be the value for the key "A" in %array, which doesn't
exist in my script.
But how can I turn it into what I want it to be?
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-mail and edited the mail. Guess use strict won't prevent that from
happening :-)
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Is it possible to test the presence of a hash key with a regexp?
something like:
if (exists ($hash{/add_\w+/})) { print "yippie!\n";}
I know that this doesn't work, but is there something similar that does?
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For addi
he sub is called before (OK) or after another sub (doesn't
work), even though that other sub does not do anything with the database
file or manipulate values accessed by this sub. Very puzzling.
Sorry if I'm not providing enough information, but it is difficult for me
to figure out what
--On Donnerstag, 23. August 2001 13:01 -0500 "Daryl J. Hoyt"
<[EMAIL PROTECTED]> wrote:
> I do not believe that you need the "&" before the function call.
I thought so, but leaving it out doesn't solve my problem either. - But
thanks anyway.
Birgit
$rec{$db_cols[$i]} = $data[$i];
}
last LINE;
}
}
close DB;
$found ?
(return %rec) :
(return undef);
}
I'd be really grateful for any hints as
are two such modules:
RTF-Generator-1.00 and RTF-Writer-1.06.
Does anyone on this list use these modules and can share experiences?
Thanks & regards,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
$key(keys %hash) {
if ($key =~ /^\d/) {push (@keys, $key); }
}
But since I know there will only be one key where this condition is true,
looping and creating an array seems like a waste.
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
stion is:
If I have one script that requires another and I want to make the former's
global variables available in the latter, and have use strict NOT complain,
what should I do? Perhaps I should not use "require", but "use"?
Birgit Kellner
--
To unsubscribe, e-
m in db2.db, and it gets returned in @hits2. In the
second loop, $firstname = "Sandra" and $lastname = "Kwack" are returned.
There's also a match for them in db2.db, but it doesn't get returned as
@hits2 - @hits2 stays with good old Charles Miller.
Second, I get the
thanks - I had foolishly assumed that if sub_one does something else apart
from generating $returnedValue, like printing out html, it would not do
that if I simply called it by assigning its return argument to a variable.
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For add
n code like this:
## main code #
my ($numhits, @hits) = @_;
for (0 .. $numhits - 1) {
&sub_one(&array_to_hash($_, @hits));
my $value = $_[0]; # is $_[0] here the return argument from sub_one?
}
end main code
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
d not by backward ones \. So,
for instance, to find out whether
a variable contains "gobbledy", you'd write:
if ($variable =~ /gobbledy/) ...
Do "perldoc perlequick" to get the "Perl regular expressions quick start"
manpage, and "perldoc perlretut" for a
ersions of NoteTab.
Current releases have Perl and Gawk support built in also in the freeware
version.
birgit kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--On Sonntag, 05. August 2001 22:33 +0200 Paul Johnson <[EMAIL PROTECTED]>
wrote:
>
> sub sonic
> {
> my ($numhits, $maxhits, @hits) = @_;
> ...
> }
>
sub genius {
print "thank you";
}
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTE
--On Sonntag, 05. August 2001 19:51 +0200 Paul Johnson <[EMAIL PROTECTED]>
wrote:
> On Sun, Aug 05, 2001 at 07:27:25PM +0200, Birgit Kellner wrote:
>> I have two files called html.pl and config.pl, both of which require
>> each other.
>>
>> The subroutine &
er, is why they were originally declared as
private variables).
Many thanks in advance,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> On Sunday 05 August 2001 8:01 am, [EMAIL PROTECTED] wrote:
>> Hello,
>> 1) How exactly do I edit a script? In Word and then change it to a .pl
>> file? Do I have to change file types back and forth every time I change
>> the script?
>>
A program that I found quite useful for writing and edi
}
}
The regexps in the second if-condition should specify that (a) the name in
the query-string is numerical, and that (b) it has a numeric value (we
exclude cases where silly users write words into the copies-field) other
than 0 (i.e. one that does not start with zero).
For all I can tell, this works. Any ideas for further simplification?
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
ke to understand why that is the case.
Just in case a user mistakenly types "0" for a book they don't want to
order, I thought I'd add the following code to remove all key/value pairs
from the hash where the value is zero:
foreach $key (keys %pairs) {
if ($pairs{$key} == 0) {
delete @pairs{"$key", "$pairs{$key}"};
}
}
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
uot;
I am using CGI.pm and would now like to parse the query-string such that
each value of "thisorder" is associated with the immediately following
value of "key". I reckon this means I should create a hash. Could anyone
point me in the right direction on how to achieve thi
--On Donnerstag, 26. Juli 2001 04:15 +0200 Birgit Kellner
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm thinking of coding a KWIC search through a text. The user chooses a
> search string and a horizon, meaning that output is to contain $i words
> to the left and to the
uot;making" as $searchstring, the print statement returns:
"index value of making is 0.
index value of making is 1.
index value of making is 2.
index value of making is 3.
index value of making is 4.
index value of making is 5.
index value of making is 6."
Help will be greatly app
a problem if the
> directory already exists, so you don't need to check it.
>
Thanks for clarifying that,
Birgit Kellner
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
dir holds "/home/somedir" and $2 holds
"/anotherdir/yetanotherdir/";
So, to check if the dir /home/somedir/anotherdir/yetanotherdir exists, I
would use:
chop($2); # remove final trailing slash
$subdir = "$admindir$2";
unless (-e "$subdir") {
mkpa
to add the requirement "if the subdirectory does
not yet exist, create it?"
TIA,
Birgit Kellner
### first we find all files in all subdirectories of directory "$origdir"
which end in *.html and
### push them into an array
$origdir = "original directory which contai
75 matches
Mail list logo