2014-02-03 Frans van Berckel <[email protected]>:
> String found where operator expected at ./zoek.pl line 4, near
> "/^Depends:.*libopus/m and print $Source'"
> (Might be a runaway multi-line '' string starting on line 2)
> (Missing semicolon on previous line?)
> syntax error at ./zoek.pl line 4, near "/^Depends:.*libopus/m and print
> $Source'"
> Execution of ./zoek.pl aborted due to compilation errors.
>
> ... wat doe ik niet goed? Begin het script met #!/usr/bin/perl
Ik denk dat je een quote te veel of te weinig hebt meegenomen in het
script. Vanaf de command-line lukt het wel. Als je het in een script
zet, moet het er als volgt uitzien:
===== zoek.pl
#!/usr/bin/perl -wnl
BEGIN {
$/="";
@ARGV = glob("/var/lib/apt/lists/*Packages");
}
/^Source: \K.*/m and $Source = $&;
/^Depends:.*libopus/m and print $Source
=====
Maar ik adviseer de oplossing van Geert te gebruiken.
Vriendelijke groet / Kind regards / Vennlig hilsen,
Arjen Bax
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive:
http://lists.debian.org/CAFXx2aOPnK5P_vRf9=RGkGp-0L4Jg==6xksar3xnjpoy4ov...@mail.gmail.com