Re: Dependencies
2014-02-03 Frans van Berckel <fberckel@xs4all.nl>:
> 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
Reply to: