File: Lib.pm

package info (click to toggle)
libmediawiki-dumpfile-perl 0.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 452 kB
  • sloc: perl: 2,003; ansic: 508; xml: 268; sql: 47; makefile: 17; sh: 2
file content (20 lines) | stat: -rw-r--r-- 283 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package MediaWiki::DumpFile::Pages::Lib;

use strict;
use warnings;

use Exporter 'import';
our @EXPORT_OK = qw(_safe_text);

sub _safe_text {
	my ($data, $name) = @_;
	my $found = $data->get_elements($name);
	
	if (! defined($found)) {
		return '';
	}
	
	 return $found->text;
}

1;